![]() |
![]() |
As the base class of all widgets this contains all of the properties and methods common to all widgets. It is an abstract class that can not be instantiated.
Important part of widgets are the* _event signals and virtual methods that every widget have. Those are events coming directly from gdk and thus also from XLib. By overriding those virtual methods you can trap everything a widget can ever do. In order to capture events from a widget, the event mask must first be set with set_events().
Only widgets with a Gdk::Window on the server side are allowed to capture events. Widgets in the Gtk::Misc group for example lack a Gdk::Window.
Public Member Functions | |
virtual | ~Widget () |
GtkWidget* | gobj () |
Provides access to the underlying C GtkObject. | |
const GtkWidget* | gobj () const |
Provides access to the underlying C GtkObject. | |
bool | set_scroll_adjustments (Adjustment& hadjustment, Adjustment& vadjustment) |
For widgets that support scrolling, sets the scroll adjustments and returns true . | |
void | show () |
Flags a widget to be displayed. | |
void | show_now () |
Shows a widget. | |
void | hide () |
Reverses the effects of show(), causing the widget to be hidden (invisible to the user). | |
void | show_all () |
Recursively shows a widget, and any child widgets (if the widget is a container). | |
void | hide_all () |
Recursively hides a widget and any child widgets. | |
void | queue_draw () |
Equivalent to calling queue_draw_area() for the entire area of a widget. | |
void | queue_draw_area (int x, int y, int width, int height) |
Invalidates the rectangular area of widget defined by x , y , width and height by calling gdk_window_invalidate_rect() on the widget's window and all its child windows. | |
void | queue_resize () |
This function is only for use in widget implementations. | |
void | size_request (GtkRequisition* requisition) |
This function is typically used when implementing a Gtk::Container subclass. | |
void | size_allocate (GtkAllocation* allocation) |
This function is only used by Gtk::Container subclasses, to assign a size and position to their child widgets. | |
void | add_accelerator (const Glib::ustring& accel_signal, const Glib::RefPtr<AccelGroup>& accel_group, guint accel_key, Gdk::ModifierType accel_mods, AccelFlags accel_flags) |
Installs an accelerator for this widget in accel_group that causes accel_signal to be emitted if the accelerator is activated. | |
bool | remove_accelerator (const Glib::RefPtr<AccelGroup>& accel_group, guint accel_key, Gdk::ModifierType accel_mods) |
Removes an accelerator from widget , previously installed with add_accelerator(). | |
void | set_accel_path (const Glib::ustring& accel_path, const Glib::RefPtr<AccelGroup>& accel_group) |
Given an accelerator group, accel_group , and an accelerator path, accel_path , sets up an accelerator in accel_group so whenever the key binding that is defined for accel_path is pressed, widget will be activated. | |
bool | mnemonic_activate (bool group_cycling) |
bool | event (GdkEvent* event) |
Rarely-used function. | |
int | send_expose (GdkEvent* event) |
Very rarely-used function. | |
bool | activate () |
For widgets that can be "activated" (buttons, menu items, etc.) this function activates them. | |
void | reparent (Widget& newparent) |
Moves a widget from one Gtk::Container to another, handling reference count issues to avoid destroying the widget. | |
bool | intersect (const Gdk::Rectangle& area) const |
bool | intersect (const Gdk::Rectangle& area, Gdk::Rectangle& intersection) const |
Computes the intersection of a widget 's area and area , storing the intersection in intersection , and returns true if there was an intersection. | |
GdkRegion* | region_intersect (GdkRegion* region) |
Computes the intersection of a widget 's area and region , returning the intersection. | |
void | freeze_child_notify () |
Stops emission of "child-notify" signals on widget . | |
void | child_notify (const Glib::ustring& child_property) |
Emits a "child-notify" signal for the child property child_property on widget . | |
void | thaw_child_notify () |
Reverts the effect of a previous call to freeze_child_notify(). | |
bool | is_focus () const |
Determines if the widget is the focus widget within its toplevel. | |
void | grab_focus () |
Causes widget to have the keyboard focus for the Gtk::Window it's inside. | |
void | grab_default () |
Causes widget to become the default widget. | |
void | set_name (const Glib::ustring& name) |
Widgets can be named, which allows you to refer to them from a gtkrc file. | |
void | unset_name () |
Glib::ustring | get_name () const |
Retrieves the name of a widget. | |
void | set_state (Gtk::StateType state) |
This function is for use in widget implementations. | |
void | set_sensitive (bool sensitive=true) |
Sets the sensitivity of a widget. | |
void | set_app_paintable (bool app_paintable=true) |
void | set_double_buffered (bool double_buffered=true) |
Widgets are double buffered by default; you can use this function to turn off the buffering. | |
void | set_redraw_on_allocate (bool redraw_on_allocate=true) |
Sets whether a when a widgets size allocation changes, the entire widget is queued for drawing. | |
void | set_child_visible (bool is_visible=true) |
Sets whether widget should be mapped along with its when its parent is mapped and widget has been shown with show(). | |
bool | get_child_visible () const |
Gets the value set with set_child_visible(). | |
Widget* | get_parent () |
Returns the parent container of widget . | |
const Widget* | get_parent () const |
Returns the parent container of widget . | |
Glib::RefPtr<Gdk::Window> | get_parent_window () |
Gets widget 's parent window. | |
Glib::RefPtr<const Gdk::Window> | get_parent_window () const |
Gets widget 's parent window. | |
void | set_parent_window (const Glib::RefPtr<const Gdk::Window>& parent_window) |
Sets a non default parent window for widget . | |
bool | child_focus (DirectionType direction) |
This function is used by custom widget implementations; if you're writing an app, you'd use grab_focus() to move the focus to a particular widget, and Gtk::Container::set_focus_chain() to change the focus tab order. | |
void | set_size_request (int width=-1, int height=-1) |
Sets the minimum size of a widget; that is, the widget's size request will be width by height . | |
void | get_size_request (int& width, int& height) const |
Gets the size request that was explicitly set for the widget using set_size_request(). | |
void | set_events (Gdk::EventMask events) |
Sets the event mask (see Gdk::EventMask) for a widget. | |
void | add_events (Gdk::EventMask events) |
Adds the events in the bitfield events to the event mask for widget . | |
void | set_extension_events (Gdk::ExtensionMode mode) |
Sets the extension events mask to mode . | |
Gdk::ExtensionMode | get_extension_events () const |
Retrieves the extension events the widget will receive; see gdk_input_set_extension_events(). | |
Widget* | get_toplevel () |
This function returns the topmost widget in the container hierarchy widget is a part of. | |
const Widget* | get_toplevel () const |
This function returns the topmost widget in the container hierarchy widget is a part of. | |
Widget* | get_ancestor (GType type) |
Gets the first ancestor of widget with type widget_type . | |
const Widget* | get_ancestor (GType type) const |
Gets the first ancestor of widget with type widget_type . | |
Glib::RefPtr<Gdk::Colormap> | get_colormap () |
Gets the colormap that will be used to render widget . | |
Glib::RefPtr<Gdk::Visual> | get_visual () |
Gets the visual that will be used to render widget . | |
Glib::RefPtr<Gdk::Screen> | get_screen () |
Get the Gdk::Screen from the toplevel window associated with this widget. | |
Glib::RefPtr<const Gdk::Screen> | get_screen () const |
Get the Gdk::Screen from the toplevel window associated with this widget. | |
bool | has_screen () const |
Checks whether there is a Gdk::Screen is associated with this widget. | |
Glib::RefPtr<Gdk::Display> | get_display () |
Get the Gdk::Display for the toplevel window associated with this widget. | |
Glib::RefPtr<const Gdk::Display> | get_display () const |
Get the Gdk::Display for the toplevel window associated with this widget. | |
Glib::RefPtr<Gdk::Window> | get_root_window () |
Get the root window where this widget is located. | |
Glib::RefPtr<const Gdk::Window> | get_root_window () const |
Get the root window where this widget is located. | |
Glib::RefPtr<Settings> | get_settings () |
Gets the settings object holding the settings (global property settings, RC file information, etc) used for this widget. | |
Glib::RefPtr<Clipboard> | get_clipboard (GdkAtom selection) |
Returns the clipboard object for the given selection to be used with widget . | |
Glib::RefPtr<const Clipboard> | get_clipboard (GdkAtom selection) const |
Returns the clipboard object for the given selection to be used with widget . | |
Glib::RefPtr<Atk::Object> | get_accessible () |
void | set_colormap (const Glib::RefPtr<const Gdk::Colormap>& colormap) |
Sets the colormap for the widget to the given value. | |
Gdk::EventMask | get_events () const |
Returns the event mask for the widget (a bitfield containing flags from the Gdk::EventMask enumeration). | |
void | get_pointer (int& x, int& y) const |
Obtains the location of the mouse pointer in widget coordinates. | |
bool | is_ancestor (Widget& widget) const |
Determines whether widget is somewhere inside ancestor , possibly with intermediate containers. | |
bool | translate_coordinates (Widget& dest_widget, int rc_x, int src_y, int& dest_x, int& dest_y) |
Translate coordinates relative to src_widget 's allocation to coordinates relative to dest_widget 's allocations. | |
void | set_style (const Glib::RefPtr<Style>& style) |
Sets the Gtk::Style for a widget ( widget ->style). | |
void | ensure_style () |
Ensures that widget has a style ( widget ->style). | |
Glib::RefPtr<Style> | get_style () |
Simply an accessor function that returns widget ->style. | |
Glib::RefPtr<const Style> | get_style () const |
Simply an accessor function that returns widget ->style. | |
void | modify_style (const Glib::RefPtr<RcStyle>& style) |
Modifies style values on the widget. | |
Glib::RefPtr<RcStyle> | get_modifier_style () |
Returns the current modifier style for the widget. | |
Glib::RefPtr<const RcStyle> | get_modifier_style () const |
Returns the current modifier style for the widget. | |
void | modify_fg (Gtk::StateType state, const Gdk::Color& color) |
Sets the foreground color for a widget in a particular state. | |
void | modify_bg (Gtk::StateType state, const Gdk::Color& color) |
Sets the background color for a widget in a particular state. | |
void | modify_bg_pixmap (Gtk::StateType state, const Glib::ustring& pixmap_name) |
void | modify_text (Gtk::StateType state, const Gdk::Color& color) |
Sets the text color for a widget in a particular state. | |
void | modify_base (Gtk::StateType state, const Gdk::Color& color) |
Sets the base color for a widget in a particular state. | |
void | modify_font (const Pango::FontDescription& font_desc) |
Sets the font to use for a widget. | |
template <class PropertyType> void | get_style_property (const Glib::ustring& property_name, PropertyType& value) const |
Glib::RefPtr<Pango::Context> | create_pango_context () |
Creates a new Pango::Context with the appropriate colormap, font description, and base direction for drawing text for this widget. | |
Glib::RefPtr<Pango::Context> | get_pango_context () |
Gets a Pango::Context with the appropriate colormap, font description and base direction for this widget. | |
Glib::RefPtr<Pango::Layout> | create_pango_layout (const Glib::ustring& text) |
Creates a new Pango::Layout with the appropriate colormap, font description, and base direction for drawing text for this widget. | |
Glib::RefPtr<Gdk::Pixbuf> | render_icon (const Gtk::StockID& stock_id, IconSize size, const Glib::ustring& detail=Glib::ustring()) |
A convenience function that uses the theme engine and RC file settings for widget to look up stock_id and render it to a pixbuf. | |
void | set_composite_name (const Glib::ustring& name) |
Sets a widgets composite name. | |
void | unset_composite_name () |
Glib::ustring | get_composite_name () const |
Obtains the composite name of a widget. | |
void | reset_rc_styles () |
void | set_direction (TextDirection dir) |
Sets the reading direction on a particular widget. | |
TextDirection | get_direction () |
Gets the reading direction for a particular widget. | |
void | shape_combine_mask (const Glib::RefPtr<const Gdk::Bitmap>& shape_mask, int offset_x, int offset_y) |
Sets a shape for this widget's GDK window. | |
void | reset_shapes () |
Recursively resets the shape on this widget and its descendants. | |
void | path (Glib::ustring& path, Glib::ustring& path_reversed) |
Compute a widget's path of the form "GtkWindow.MyLabel". | |
void | class_path (Glib::ustring& path, Glib::ustring& path_reversed) |
void | drag_get_data (const Glib::RefPtr<Gdk::DragContext>& context, GdkAtom target, guint32 time) |
void | drag_highlight () |
void | drag_unhighlight () |
void | drag_dest_set (DestDefaults flags=DestDefaults(0), Gdk::DragAction actions=Gdk::DragAction(0)) |
void | drag_dest_set (const ArrayHandle_TargetEntry& targets, DestDefaults flags=DEST_DEFAULT_ALL, Gdk::DragAction actions=Gdk::ACTION_COPY) |
void | drag_dest_set_proxy (const Glib::RefPtr<Gdk::Window>& proxy_window, Gdk::DragProtocol protocol, bool use_coordinates) |
void | drag_dest_unset () |
GdkAtom | drag_dest_find_target (const Glib::RefPtr<Gdk::DragContext>& context, GtkTargetList* target_list) |
Looks for a match between context ->targets and the dest_target_list , returning the first matching target, otherwise returning Gdk::NONE. | |
GtkTargetList* | drag_dest_get_target_list () |
Returns the list of targets this widget can accept from drag-and-drop. | |
void | drag_dest_set_target_list (GtkTargetList* target_list) |
Sets the target types that this widget can accept from drag-and-drop. | |
void | drag_source_set (const ArrayHandle_TargetEntry& targets, Gdk::ModifierType start_button_mask=Gdk::MODIFIER_MASK, Gdk::DragAction actions=Gdk::ACTION_COPY) |
void | drag_source_unset () |
void | drag_source_set_icon (const Glib::RefPtr<Gdk::Colormap>& colormap, const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask) |
Sets the icon that will be used for drags from a particular widget from a pixmap/mask. | |
void | drag_source_set_icon (const Glib::RefPtr<Gdk::Pixbuf>& pixbuf) |
Sets the icon that will be used for drags from a particular widget from a Gdk::Pixbuf. | |
void | drag_source_set_icon (const Gtk::StockID& stock_id) |
Sets the icon that will be used for drags from a particular source to a stock icon. | |
Glib::RefPtr<Gdk::DragContext> | drag_begin (GtkTargetList* targets, Gdk::DragAction actions, gint button, GdkEvent* event) |
bool | drag_check_threshold (int start_x, int start_y, int current_x, int current_y) |
Checks to see if a mouse drag starting at ( start_x , start_y ) and ending at ( current_x , current_y ) has passed the GTK+ drag threshhold, and thus should trigger the beginning of a drag-and-drop operation. | |
void | drag_set_as_icon (const Glib::RefPtr<Gdk::DragContext>& context, int hot_x, int hot_y) |
bool | is_toplevel () const |
bool | has_no_window () const |
bool | is_realized () const |
bool | is_mapped () const |
bool | is_visible () const |
bool | is_drawable () const |
bool | sensitive () const |
bool | parent_sensitive () const |
bool | is_sensitive () const |
bool | can_focus () const |
bool | has_focus () const |
bool | can_default () const |
bool | has_default () const |
bool | has_grab () const |
bool | rc_style () const |
bool | is_composite_child () const |
bool | app_paintable () const |
bool | receives_default () const |
bool | double_buffered () const |
WidgetFlags | get_flags () const |
void | set_flags (WidgetFlags flags) |
void | unset_flags (WidgetFlags flags) |
int | get_width () const |
int | get_height () const |
Gtk::StateType | get_state () const |
Gtk::StateType | get_saved_state () const |
GtkRequisition | get_requisition () const |
GtkAllocation | get_allocation () const |
Glib::RefPtr<Gdk::Window> | get_window () |
Glib::RefPtr<const Gdk::Window> | get_window () const |
Glib::SignalProxy0<void> | signal_show () |
Glib::SignalProxy0<void> | signal_hide () |
Glib::SignalProxy0<void> | signal_map () |
Glib::SignalProxy0<void> | signal_unmap () |
Glib::SignalProxy0<void> | signal_realize () |
Glib::SignalProxy0<void> | signal_unrealize () |
Glib::SignalProxy1< void, GtkRequisition* > | signal_size_request () |
Glib::SignalProxy1< void, GtkAllocation* > | signal_size_allocate () |
Glib::SignalProxy1< void, Gtk::StateType > | signal_state_changed () |
Glib::SignalProxy1< void, Widget* > | signal_parent_changed () |
Glib::SignalProxy1< void, Widget* > | signal_hierarchy_changed () |
Glib::SignalProxy1< void, const Glib::RefPtr<Style >&> | signal_style_changed () |
Glib::SignalProxy1< void, TextDirection > | signal_direction_changed () |
Glib::SignalProxy1< void, bool > | signal_grab_notify () |
Glib::SignalProxy1< void, GParamSpec* > | signal_child_notify () |
Glib::SignalProxy1< bool, bool > | signal_mnemonic_activate () |
Glib::SignalProxy0<void> | signal_grab_focus () |
Glib::SignalProxy1< bool, DirectionType > | signal_focus () |
Glib::SignalProxy1< bool, GdkEvent* > | signal_event () |
Glib::SignalProxy1< bool, GdkEventButton* > | signal_button_press_event () |
Glib::SignalProxy1< bool, GdkEventButton* > | signal_button_release_event () |
Glib::SignalProxy1< bool, GdkEventScroll* > | signal_scroll_event () |
Glib::SignalProxy1< bool, GdkEventMotion* > | signal_motion_notify_event () |
Glib::SignalProxy1< bool, GdkEventAny* > | signal_delete_event () |
Glib::SignalProxy1< bool, GdkEventExpose* > | signal_expose_event () |
Glib::SignalProxy1< bool, GdkEventKey* > | signal_key_press_event () |
Glib::SignalProxy1< bool, GdkEventKey* > | signal_key_release_event () |
Glib::SignalProxy1< bool, GdkEventCrossing* > | signal_enter_notify_event () |
Glib::SignalProxy1< bool, GdkEventCrossing* > | signal_leave_notify_event () |
Glib::SignalProxy1< bool, GdkEventConfigure* > | signal_configure_event () |
Glib::SignalProxy1< bool, GdkEventFocus* > | signal_focus_in_event () |
Glib::SignalProxy1< bool, GdkEventFocus* > | signal_focus_out_event () |
Glib::SignalProxy1< bool, GdkEventAny* > | signal_map_event () |
Glib::SignalProxy1< bool, GdkEventAny* > | signal_unmap_event () |
Glib::SignalProxy1< bool, GdkEventProperty* > | signal_property_notify_event () |
Glib::SignalProxy1< bool, GdkEventSelection* > | signal_selection_clear_event () |
Glib::SignalProxy1< bool, GdkEventSelection* > | signal_selection_request_event () |
Glib::SignalProxy1< bool, GdkEventSelection* > | signal_selection_notify_event () |
Glib::SignalProxy1< bool, GdkEventProximity* > | signal_proximity_in_event () |
Glib::SignalProxy1< bool, GdkEventProximity* > | signal_proximity_out_event () |
Glib::SignalProxy1< bool, GdkEventVisibility* > | signal_visibility_notify_event () |
Glib::SignalProxy1< bool, GdkEventClient* > | signal_client_event () |
Glib::SignalProxy1< bool, GdkEventAny* > | signal_no_expose_event () |
Glib::SignalProxy1< bool, GdkEventWindowState* > | signal_window_state_event () |
Glib::SignalProxy3< void, GtkSelectionData *, guint, guint > | signal_selection_get () |
Glib::SignalProxy2< void, GtkSelectionData*, guint > | signal_selection_received () |
Glib::SignalProxy1< void, const Glib::RefPtr<Gdk::DragContext >&> | signal_drag_begin () |
Glib::SignalProxy1< void, const Glib::RefPtr<Gdk::DragContext >&> | signal_drag_end () |
Glib::SignalProxy4< void, const Glib::RefPtr<Gdk::DragContext>&, GtkSelectionData *, guint, guint > | signal_drag_data_get () |
Glib::SignalProxy1< void, const Glib::RefPtr<Gdk::DragContext >&> | signal_drag_data_delete () |
Glib::SignalProxy2< void, const Glib::RefPtr<Gdk::DragContext>&, guint > | signal_drag_leave () |
Glib::SignalProxy4< bool, const Glib::RefPtr<Gdk::DragContext>&, int, int, guint > | signal_drag_motion () |
Glib::SignalProxy4< bool, const Glib::RefPtr<Gdk::DragContext>&, int, int, guint > | signal_drag_drop () |
Glib::SignalProxy6< void, const Glib::RefPtr<Gdk::DragContext>&, int, int, GtkSelectionData *, guint, guint > | signal_drag_data_received () |
Glib::SignalProxy0<bool> | signal_popup_menu () |
Glib::SignalProxy1< bool, WidgetHelpType > | signal_show_help () |
Glib::PropertyProxy<Glib::ustring> | property_name () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<Container*> | property_parent () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<int> | property_width_request () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<int> | property_height_request () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_visible () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_sensitive () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_app_paintable () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_can_focus () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_has_focus () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_can_default () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_has_default () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_receives_default () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly< bool > | property_composite_child () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy< Glib::RefPtr< Style > > | property_style () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<Gdk::EventMask> | property_events () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<Gdk::ExtensionMode> | property_extension_events () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Static Public Member Functions | |
void | push_colormap (const Glib::RefPtr<const Gdk::Colormap>& cmap) |
Pushes cmap onto a global stack of colormaps; the topmost colormap on the stack will be used to create all widgets. | |
void | pop_colormap () |
Removes a colormap pushed with push_colormap(). | |
void | push_composite_child () |
Makes all newly-created widgets as composite children until the corresponding pop_composite_child() call. | |
void | pop_composite_child () |
Cancels the effect of a previous call to push_composite_child(). | |
void | set_default_colormap (const Glib::RefPtr<const Gdk::Colormap>& colormap) |
Sets the default colormap to use when creating widgets. | |
Glib::RefPtr<Style> | get_default_style () |
Returns the default style used by all widgets initially. | |
Glib::RefPtr<Gdk::Colormap> | get_default_colormap () |
Obtains the default colormap used to create widgets. | |
Glib::RefPtr<Gdk::Visual> | get_default_visual () |
Obtains the visual of the default colormap. | |
void | set_default_direction (TextDirection dir) |
Sets the default reading direction for widgets where the direction has not been explicitly set by set_direction(). | |
TextDirection | get_default_direction () |
Obtains the current default reading direction. | |
Widget* | drag_get_source_widget (const Glib::RefPtr<Gdk::DragContext>& context) |
Protected Member Functions | |
virtual void | dispatch_child_properties_changed_vfunc (guint p1, GParamSpec** p2) |
virtual void | show_all_vfunc () |
virtual void | hide_all_vfunc () |
virtual Glib::RefPtr<Atk::Object> | get_accessible_vfunc () |
virtual void | on_show () |
virtual void | on_hide () |
virtual void | on_map () |
virtual void | on_unmap () |
virtual void | on_realize () |
virtual void | on_unrealize () |
virtual void | on_size_request (GtkRequisition* requisition) |
virtual void | on_size_allocate (GtkAllocation* allocation) |
virtual void | on_state_changed (Gtk::StateType previous_state) |
virtual void | on_parent_changed (Widget* previous_parent) |
virtual void | on_hierarchy_changed (Widget* previous_toplevel) |
virtual void | on_style_changed (const Glib::RefPtr<Style>& previous_style) |
virtual void | on_direction_changed (TextDirection direction) |
virtual void | on_grab_notify (bool was_grabbed) |
virtual void | on_child_notify (GParamSpec* pspec) |
virtual bool | on_mnemonic_activate (bool group_cycling) |
virtual void | on_grab_focus () |
virtual bool | on_focus (DirectionType direction) |
virtual bool | on_event (GdkEvent* event) |
virtual bool | on_button_press_event (GdkEventButton* event) |
virtual bool | on_button_release_event (GdkEventButton* event) |
virtual bool | on_scroll_event (GdkEventScroll* event) |
virtual bool | on_motion_notify_event (GdkEventMotion* event) |
virtual bool | on_delete_event (GdkEventAny* event) |
virtual bool | on_expose_event (GdkEventExpose* event) |
virtual bool | on_key_press_event (GdkEventKey* event) |
virtual bool | on_key_release_event (GdkEventKey* event) |
virtual bool | on_enter_notify_event (GdkEventCrossing* event) |
virtual bool | on_leave_notify_event (GdkEventCrossing* event) |
virtual bool | on_configure_event (GdkEventConfigure* event) |
virtual bool | on_focus_in_event (GdkEventFocus* event) |
virtual bool | on_focus_out_event (GdkEventFocus* event) |
virtual bool | on_map_event (GdkEventAny* event) |
virtual bool | on_unmap_event (GdkEventAny* event) |
virtual bool | on_property_notify_event (GdkEventProperty* event) |
virtual bool | on_selection_clear_event (GdkEventSelection* event) |
virtual bool | on_selection_request_event (GdkEventSelection* event) |
virtual bool | on_selection_notify_event (GdkEventSelection* event) |
virtual bool | on_proximity_in_event (GdkEventProximity* event) |
virtual bool | on_proximity_out_event (GdkEventProximity* event) |
virtual bool | on_visibility_notify_event (GdkEventVisibility* event) |
virtual bool | on_client_event (GdkEventClient* event) |
virtual bool | on_no_expose_event (GdkEventAny* event) |
virtual bool | on_window_state_event (GdkEventWindowState* event) |
virtual void | on_selection_get (GtkSelectionData* selection_data, guint info, guint time) |
virtual void | on_selection_received (GtkSelectionData* selection_data, guint time) |
virtual void | on_drag_begin (const Glib::RefPtr<Gdk::DragContext>& context) |
virtual void | on_drag_end (const Glib::RefPtr<Gdk::DragContext>& context) |
virtual void | on_drag_data_get (const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time) |
virtual void | on_drag_data_delete (const Glib::RefPtr<Gdk::DragContext>& context) |
virtual void | on_drag_leave (const Glib::RefPtr<Gdk::DragContext>& context, guint time) |
virtual bool | on_drag_motion (const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time) |
virtual bool | on_drag_drop (const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time) |
virtual void | on_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, GtkSelectionData* selection_data, guint info, guint time) |
virtual bool | on_popup_menu () |
virtual bool | on_show_help (WidgetHelpType p1) |
Widget () | |
void | map () |
This function is only for use in widget implementations. | |
void | unmap () |
This function is only for use in widget implementations. | |
void | realize () |
Creates the GDK (windowing system) resources associated with a widget. | |
void | unrealize () |
This function is only useful in widget implementations. | |
void | set_parent (Widget& parent) |
This function is useful only when implementing subclasses of Gtk::Container. | |
void | unparent () |
This function is only for use in widget implementations. | |
void | get_child_requisition (GtkRequisition* requisition) |
This function is only for use in widget implementations. | |
void | get_style_property_value (const Glib::ustring& property_name, Glib::ValueBase& value) const |
Gets the value of a style property of widget . | |
void | realize_if_needed () |
Friends | |
class | Main |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::Widget* | wrap (GtkWidget* object, bool take_copy=false) |
|
|
|
|
|
For widgets that can be "activated" (buttons, menu items, etc.) this function activates them.
Activation is what happens when you press Enter on a widget during key navigation; clicking a button, selecting a menu item, etc. If widget isn't activatable, the function returns
Reimplemented in Gtk::MenuItem. |
|
Installs an accelerator for this widget in accel_group that causes accel_signal to be emitted if the accelerator is activated. The accel_group needs to be added to the widget's toplevel via Gtk::Window::add_accel_group(), and the signal must be of type G::RUN_ACTION. Accelerators added through this function are not user changeable during runtime. If you want to support accelerators that can be changed by the user, use gtk_accel_map_add_entry() and set_accel_path() or Gtk::MenuItem::set_accel_path() instead.
|
|
Adds the events in the bitfield events to the event mask for widget . See set_events() for details.
|
|
|
|
|
|
|
|
This function is used by custom widget implementations; if you're writing an app, you'd use grab_focus() to move the focus to a particular widget, and Gtk::Container::set_focus_chain() to change the focus tab order. So you may want to investigate those functions instead. child_focus() is called by containers as the user moves around the window using keyboard shortcuts. direction indicates what kind of motion is taking place (up, down, left, right, tab forward, tab backward). child_focus() invokes the "focus" signal on Gtk::Widget; widgets override the default handler for this signal in order to implement appropriate focus behavior.
The "focus" default handler for a widget should return
This function replaces gtk_container_focus() from GTK+ 1.2. It was necessary to check that the child was visible, sensitive, and focusable before calling gtk_container_focus(). child_focus() returns
|
|
Emits a "child-notify" signal for the child property child_property on widget . This is the analogue of Glib::object_notify() for child properties.
|
|
|
|
Creates a new Pango::Context with the appropriate colormap, font description, and base direction for drawing text for this widget. See also get_pango_context().
|
|
Creates a new Pango::Layout with the appropriate colormap, font description, and base direction for drawing text for this widget. If you keep a Pango::Layout created in this way around, in order notify the layout of changes to the base direction or font of this widget, you must call pango_layout_context_changed() in response to the ::style_set and ::direction_set signals for the widget.
|
|
|
|
|
|
|
|
Checks to see if a mouse drag starting at ( start_x , start_y ) and ending at ( current_x , current_y ) has passed the GTK+ drag threshhold, and thus should trigger the beginning of a drag-and-drop operation.
|
|
Looks for a match between context ->targets and the dest_target_list , returning the first matching target, otherwise returning Gdk::NONE. dest_target_list should usually be the return value from gtk_drag_dest_get_target_list(), but some widgets may have different valid targets for different parts of the widget; in that case, they will have to implement a drag_motion handler that passes the correct target list to this function.
|
|
Returns the list of targets this widget can accept from drag-and-drop.
|
|
|
|
|
|
|
|
Sets the target types that this widget can accept from drag-and-drop. The widget must first be made into a drag destination with gtk_drag_dest_set().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sets the icon that will be used for drags from a particular source to a stock icon.
|
|
Sets the icon that will be used for drags from a particular widget from a Gdk::Pixbuf. GTK+ retains a reference for pixbuf and will release it when it is no longer needed.
|
|
Sets the icon that will be used for drags from a particular widget from a pixmap/mask. GTK+ retains references for the arguments, and will release them when they are no longer needed. Use gtk_drag_source_set_icon_pixbuf() instead.
|
|
|
|
|
|
Ensures that widget has a style ( widget ->style). Not a very useful function; most of the time, if you want the style, the widget is realized, and realized widgets are guaranteed to have a style already. |
|
Rarely-used function. This function is used to emit the event signals on a widget (those signals should never be emitted without using this function to do so). If you want to synthesize an event though, don't use this function; instead, use gtk_main_do_event() so the event will behave as if it were in the event queue. Don't synthesize expose events; instead, use gdk_window_invalidate_rect() to invalidate a region of the window.
|
|
Stops emission of "child-notify" signals on widget . The signals are queued until thaw_child_notify() is called on widget . This is the analogue of Glib::object_freeze_notify() for child properties. |
|
|
|
|
|
|
|
Gets the first ancestor of widget with type widget_type .
For example, Note that unlike is_ancestor(), get_ancestor() considers widget to be an ancestor of itself.
|
|
Gets the first ancestor of widget with type widget_type .
For example, Note that unlike is_ancestor(), get_ancestor() considers widget to be an ancestor of itself.
|
|
This function is only for use in widget implementations. Obtains widget ->requisition, unless someone has forced a particular geometry on the widget (e.g. with set_usize()), in which case it returns that geometry instead of the widget's requisition. This function differs from size_request() in that it retrieves the last size request value from widget ->requisition, while size_request() actually calls the "size_request" method on widget to compute the size request and fill in widget ->requisition, and only then returns widget ->requisition. Because this function does not call the "size_request" method, it can only be used when you know that widget ->requisition is up-to-date, that is, size_request() has been called since the last time a resize was queued. In general, only container implementations have this information; applications should use size_request().
|
|
Gets the value set with set_child_visible(). If you feel a need to use this function, your code probably needs reorganization. This function is only useful for container implementations and never should be called by an application.
|
|
Returns the clipboard object for the given selection to be used with widget . widget must have a Gdk::Display associated with it, so must be attached to a toplevel window.
|
|
Returns the clipboard object for the given selection to be used with widget . widget must have a Gdk::Display associated with it, so must be attached to a toplevel window.
|
|
Gets the colormap that will be used to render widget . No reference will be added to the returned colormap; it should not be unreferenced.
|
|
Obtains the composite name of a widget.
|
|
Obtains the default colormap used to create widgets.
|
|
Obtains the current default reading direction.
|
|
Returns the default style used by all widgets initially.
|
|
Obtains the visual of the default colormap. Not really useful; used to be useful before gdk_colormap_get_visual() existed.
|
|
Gets the reading direction for a particular widget. See set_direction().
|
|
Get the Gdk::Display for the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Gtk::Window at the top. In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.
|
|
Get the Gdk::Display for the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Gtk::Window at the top. In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.
|
|
Returns the event mask for the widget (a bitfield containing flags from the Gdk::EventMask enumeration). These are the events that the widget will receive.
|
|
Retrieves the extension events the widget will receive; see gdk_input_set_extension_events().
|
|
|
|
|
|
Returns the current modifier style for the widget. (As set by modify_style().) If no style has previously set, a new Gtk::RcStyle will be created with all values unset, and set as the modifier style for the widget. If you make changes to this rc style, you must call modify_style(), passing in the returned rc style, to make sure that your changes take effect. Caution: passing the style back to modify_style() will normally end up destroying it, because modify_style() copies the passed-in style and sets the copy as the new modifier style, thus dropping any reference to the old modifier style. Add a reference to the modifier style if you want to keep it alive.
|
|
Returns the current modifier style for the widget. (As set by modify_style().) If no style has previously set, a new Gtk::RcStyle will be created with all values unset, and set as the modifier style for the widget. If you make changes to this rc style, you must call modify_style(), passing in the returned rc style, to make sure that your changes take effect. Caution: passing the style back to modify_style() will normally end up destroying it, because modify_style() copies the passed-in style and sets the copy as the new modifier style, thus dropping any reference to the old modifier style. Add a reference to the modifier style if you want to keep it alive.
|
|
Retrieves the name of a widget. See set_name() for the significance of widget names.
|
|
Gets a Pango::Context with the appropriate colormap, font description and base direction for this widget. Unlike the context returned by create_pango_context(), this context is owned by the widget (it can be used until the screen for the widget changes or the widget is removed from its toplevel), and will be updated to match any changes to the widget's attributes. If you create and keep a Pango::Layout using this context, you must deal with changes to the context by calling pango_layout_context_changed() on the layout in response to the ::style_set and ::direction_set signals for the widget.
|
|
Returns the parent container of widget .
|
|
Returns the parent container of widget .
|
|
Gets widget 's parent window.
|
|
Gets widget 's parent window.
|
|
Obtains the location of the mouse pointer in widget coordinates. Widget coordinates are a bit odd; for historical reasons, they are defined as widget ->window coordinates for widgets that are not Gtk::NO_WINDOW widgets, and are relative to widget ->allocation.x, widget ->allocation.y for widgets that are Gtk::NO_WINDOW widgets.
|
|
|
|
Get the root window where this widget is located. This function can only be called after the widget has been added to a widget heirarchy with Gtk::Window at the top. The root window is useful for such purposes as creating a popup Gdk::Window associated with the window. In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.
|
|
Get the root window where this widget is located. This function can only be called after the widget has been added to a widget heirarchy with Gtk::Window at the top. The root window is useful for such purposes as creating a popup Gdk::Window associated with the window. In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.
|
|
|
|
Get the Gdk::Screen from the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Gtk::Window at the top. In general, you should only create screen specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.
Reimplemented in Gtk::Invisible, and Gtk::Window. |
|
Get the Gdk::Screen from the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Gtk::Window at the top. In general, you should only create screen specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.
Reimplemented in Gtk::Invisible, and Gtk::Window. |
|
Gets the settings object holding the settings (global property settings, RC file information, etc) used for this widget. Note that this function can only be called when the Gtk::Widget is attached to a toplevel, since the settings object is specific to a particular Gdk::Screen.
|
|
Gets the size request that was explicitly set for the widget using set_size_request(). A value of -1 stored in width or height indicates that that dimension has not been set explicitly and the natural requisition of the widget will be used intead. See set_size_request(). To get the size a widget will actually use, call size_request() instead of this function.
|
|
|
|
Simply an accessor function that returns widget ->style.
|
|
Simply an accessor function that returns widget ->style.
|
|
|
|
Gets the value of a style property of widget .
|
|
This function returns the topmost widget in the container hierarchy widget is a part of. If widget has no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced.
Note the difference in behavior vs. get_ancestor(); To reliably find the toplevel Gtk::Window, use get_toplevel() and check if the T::OPLEVEL flags is set on the result. GtkWidget* toplevel = gtk_widget_get_toplevel (widget);
if (GTK_WIDGET_TOPLEVEL (toplevel))
{
[ Perform action on toplevel. ]
}
|
|
This function returns the topmost widget in the container hierarchy widget is a part of. If widget has no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced.
Note the difference in behavior vs. get_ancestor(); To reliably find the toplevel Gtk::Window, use get_toplevel() and check if the T::OPLEVEL flags is set on the result. GtkWidget* toplevel = gtk_widget_get_toplevel (widget);
if (GTK_WIDGET_TOPLEVEL (toplevel))
{
[ Perform action on toplevel. ]
}
|
|
Gets the visual that will be used to render widget .
|
|
|
|
|
|
|
|
|
|
Causes widget to become the default widget.
widget must have the Gtk::CAN_DEFAULT flag set; typically you have to set this flag yourself by calling |
|
Causes widget to have the keyboard focus for the Gtk::Window it's inside. widget must be a focusable widget, such as a Gtk::Entry; something like Gtk::Frame won't work. (More precisely, it must have the Gtk::CAN_FOCUS flag set.) |
|
|
|
|
|
|
|
|
|
Checks whether there is a Gdk::Screen is associated with this widget. All toplevel widgets have an associated screen, and all widgets added into a heirarchy with a toplevel window at the top.
|
|
Reverses the effects of show(), causing the widget to be hidden (invisible to the user).
|
|
Recursively hides a widget and any child widgets.
|
|
|
|
Computes the intersection of a widget 's area and area , storing the intersection in intersection , and returns
intersection may be
|
|
|
|
Determines whether widget is somewhere inside ancestor , possibly with intermediate containers.
|
|
|
|
|
|
Determines if the widget is the focus widget within its toplevel. (This does not mean that the HAS_FOCUS flag is necessarily set; HAS_FOCUS will only be set if the toplevel widget additionally has the global input focus.)
|
|
|
|
|
|
|
|
Reimplemented in Gtk::Window. |
|
|
|
This function is only for use in widget implementations. Causes a widget to be mapped if it isn't already. |
|
|
|
Sets the base color for a widget in a particular state. All other style values are left untouched. The base color is the background color used along with the text color (see modify_text()) for widgets such as Gtk::Entry and Gtk::TextView. See also modify_style().
|
|
Sets the background color for a widget in a particular state. All other style values are left untouched. See also modify_style().
|
|
|
|
Sets the foreground color for a widget in a particular state. All other style values are left untouched. See also modify_style().
|
|
Sets the font to use for a widget. All other style values are left untouched. See also modify_style().
|
|
Modifies style values on the widget. Modifications made using this technique take precedence over style values set via an RC file, however, they will be overriden if a style is explicitely set on the widget using set_style(). The Gtk::RcStyle structure is designed so each field can either be set or unset, so it is possible, using this function, to modify some style values and leave the others unchanged. Note that modifications made with this function are not cumulative with previous calls to modify_style() or with such functions as modify_fg(). If you wish to retain previous values, you must first call get_modifier_style(), make your modifications to the returned style, then call modify_style() with that style. On the other hand, if you first call modify_style(), subsequent calls to such functions modify_fg() will have a cumulative effect with the initial modifications.
|
|
Sets the text color for a widget in a particular state. All other style values are left untouched. The text color is the foreground color used along with the base color (see modify_base()) for widgets such as Gtk::Entry and Gtk::TextView. See also modify_style().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Compute a widget's path of the form "GtkWindow.MyLabel".
|
|
Removes a colormap pushed with push_colormap().
|
|
Cancels the effect of a previous call to push_composite_child().
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Pushes cmap onto a global stack of colormaps; the topmost colormap on the stack will be used to create all widgets. Remove cmap with pop_colormap(). There's little reason to use this function.
|
|
Makes all newly-created widgets as composite children until the corresponding pop_composite_child() call. A composite child is a child that's an implementation detail of the container it's inside and should not be visible to people using the container. Composite children aren't treated differently by GTK (but see Gtk::Container::foreach() vs. Gtk::Container::forall()), but e.g. GUI builders might want to treat them in a different way. Here is a simple example: gtk_widget_push_composite_child (<!-- -->);
scrolled_window->hscrollbar = gtk_hscrollbar_new (hadjustment);
gtk_widget_set_composite_name (scrolled_window->hscrollbar, "hscrollbar");
gtk_widget_pop_composite_child (<!-- -->);
gtk_widget_set_parent (scrolled_window->hscrollbar,
GTK_WIDGET (scrolled_window));
g_object_ref (scrolled_window->hscrollbar);
|
|
Equivalent to calling queue_draw_area() for the entire area of a widget.
|
|
Invalidates the rectangular area of widget defined by x , y , width and height by calling gdk_window_invalidate_rect() on the widget's window and all its child windows. Once the main loop becomes idle (after the current batch of events has been processed, roughly), the window will receive expose events for the union of all regions that have been invalidated. Normally you would only use this function in widget implementations. You might also use it, or gdk_window_invalidate_rect() directly, to schedule a redraw of a Gtk::DrawingArea or some portion thereof. Frequently you can just call gdk_window_invalidate_rect() or gdk_window_invalidate_region() instead of this function. Those functions will invalidate only a single window, instead of the widget and all its children. The advantage of adding to the invalidated region compared to simply drawing immediately is efficiency; using an invalid region ensures that you only have to redraw one time.
|
|
This function is only for use in widget implementations. Flags a widget to have its size renegotiated; should be called when a widget for some reason has a new size request. For example, when you change the text in a Gtk::Label, Gtk::Label queues a resize to ensure there's enough space for the new text. |
|
|
|
Creates the GDK (windowing system) resources associated with a widget. For example, widget ->window will be created when a widget is realized. Normally realization happens implicitly; if you show a widget and all its parent containers, then the widget will be realized and mapped automatically. Realizing a widget requires all the widget's parent widgets to be realized; calling realize() realizes the widget's parents in addition to widget itself. If a widget is not yet inside a toplevel window when you realize it, bad things will happen. This function is primarily used in widget implementations, and isn't very useful otherwise. Many times when you think you might need it, a better approach is to connect to a signal that will be called after the widget is realized automatically, such as "expose_event". Or simply Glib::signal_connect_after() to the "realize" signal. |
|
|
|
|
|
Computes the intersection of a widget 's area and region , returning the intersection. The result may be empty, use gdk_region_empty() to check.
|
|
Removes an accelerator from widget , previously installed with add_accelerator().
|
|
A convenience function that uses the theme engine and RC file settings for widget to look up stock_id and render it to a pixbuf. stock_id should be a stock icon ID such as Gtk::STOCK_OPEN or Gtk::STOCK_OK. size should be a size such as Gtk::ICON_SIZE_MENU. detail should be a string that identifies the widget or code doing the rendering, so that theme engines can special-case rendering for that widget or code. The pixels in the returned Gdk::Pixbuf are shared with the rest of the application and should not be modified. The pixbuf should be freed after use with Glib::object_unref().
|
|
Moves a widget from one Gtk::Container to another, handling reference count issues to avoid destroying the widget.
|
|
|
|
Recursively resets the shape on this widget and its descendants.
|
|
Very rarely-used function. This function is used to emit an expose event signals on a widget. This function is not normally used directly. The only time it is used is when propagating an expose event to a child NO_WINDOW widget, and that is normally done using Gtk::Container::propagate_expose(). If you want to force an area of a window to be redrawn, use gdk_window_invalidate_rect() or gdk_window_invalidate_region(). To cause the redraw to be done immediately, follow that call with a call to gdk_window_process_updates().
|
|
|
|
Given an accelerator group, accel_group , and an accelerator path, accel_path , sets up an accelerator in accel_group so whenever the key binding that is defined for accel_path is pressed, widget will be activated. This removes any accelerators (for any accelerator group) installed by previous calls to set_accel_path(). Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (See gtk_accel_map_save().) This function is a low level function that would most likely be used by a menu creation system like Gtk::ItemFactory. If you use Gtk::ItemFactory, setting up accelerator paths will be done automatically. Even when you you aren't using Gtk::ItemFactory, if you only want to set up accelerators on menu items Gtk::MenuItem::set_accel_path() provides a somewhat more convenient interface.
|
|
|
|
Sets whether widget should be mapped along with its when its parent is mapped and widget has been shown with show().
The child visibility can be set for widget before it is added to a container with set_parent(), to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state of Note that changing the child visibility of a widget does not queue a resize on the widget. Most of the time, the size of a widget is computed from all visible children, whether or not they are mapped. If this is not the case, the container can queue a resize itself. This function is only useful for container implementations and never should be called by an application.
|
|
Sets the colormap for the widget to the given value.
Widget must not have been previously realized. This probably should only be used from an
|
|
Sets a widgets composite name. The widget must be a composite child of its parent; see push_composite_child().
|
|
Sets the default colormap to use when creating widgets. push_colormap() is a better function to use if you only want to affect a few widgets, rather than all widgets.
|
|
Sets the default reading direction for widgets where the direction has not been explicitly set by set_direction().
|
|
Sets the reading direction on a particular widget. This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction present, except for containers where the containers are arranged in an order that is explicitely visual rather than logical (such as buttons for text justification). If the direction is set to Gtk::TEXT_DIR_NONE, then the value set by set_default_direction() will be used.
|
|
Widgets are double buffered by default; you can use this function to turn off the buffering. "Double buffered" simply means that gdk_window_begin_paint_region() and gdk_window_end_paint() are called automatically around expose events sent to the widget. gdk_window_begin_paint() diverts all drawing to a widget's window to an offscreen buffer, and gdk_window_end_paint() draws the buffer to the screen. The result is that users see the window update in one smooth step, and don't see individual graphics primitives being rendered. In very simple terms, double buffered widgets don't flicker, so you would only use this function to turn off double buffering if you had special needs and really knew what you were doing.
|
|
Sets the event mask (see Gdk::EventMask) for a widget. The event mask determines which events a widget will receive. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget's functionality, so be careful. This function must be called while a widget is unrealized. Consider add_events() for widgets that are already realized, or if you want to preserve the existing event mask. This function can't be used with Gtk::NO_WINDOW widgets; to get events on those widgets, place them inside a Gtk::EventBox and receive events on the event box.
|
|
Sets the extension events mask to mode . See Gdk::ExtensionMode and gdk_input_set_extension_events().
|
|
|
|
Widgets can be named, which allows you to refer to them from a gtkrc file. You can apply a style to widgets with a particular name in the gtkrc file. See the documentation for gtkrc files (on the same page as the docs for Gtk::RcStyle).
|
|
This function is useful only when implementing subclasses of Gtk::Container. Sets the container as the parent of widget , and takes care of some details such as updating the state and style of the child to reflect its new location. The opposite function is unparent().
|
|
Sets a non default parent window for widget .
|
|
Sets whether a when a widgets size allocation changes, the entire widget is queued for drawing.
By default, this setting is
Note that for NO_WINDOW widgets setting this flag to
|
|
For widgets that support scrolling, sets the scroll adjustments and returns
For widgets that don't support scrolling, does nothing and returns
|
|
Sets the sensitivity of a widget. A widget is sensitive if the user can interact with it. Insensitive widgets are "grayed out" and the user can't interact with them. Insensitive widgets are known as "inactive", "disabled", or "ghosted" in some other toolkits.
|
|
Sets the minimum size of a widget; that is, the widget's size request will be width by height . You can use this function to force a widget to be either larger or smaller than it normally would be. In most cases, Gtk::Window::set_default_size() is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request. When dealing with window sizes, Gtk::Window::set_geometry_hints() can be a useful function as well. Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it's basically impossible to hardcode a size that will always be correct. The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested. If the size request in a given direction is -1 (unset), then the "natural" size request of the widget will be used instead. Widgets can't actually be allocated a size less than 1 by 1, but you can pass 0,0 to this function to mean "as small as possible."
|
|
This function is for use in widget implementations. Sets the state of a widget (insensitive, prelighted, etc.) Usually you should set the state using wrapper functions such as set_sensitive().
|
|
Sets the Gtk::Style for a widget ( widget ->style). You probably don't want to use this function; it interacts badly with themes, because themes work by replacing the Gtk::Style. Instead, use modify_style().
|
|
Sets a shape for this widget's GDK window. This allows for transparent windows etc., see gdk_window_shape_combine_mask() for more information.
|
|
Flags a widget to be displayed. Any widget that isn't shown will not appear on the screen. If you want to show all the widgets in a container, it's easier to call show_all() on the container, instead of individually showing the widgets. Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen. When a toplevel container is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel container is realized and mapped. |
|
Recursively shows a widget, and any child widgets (if the widget is a container).
|
|
|
|
Shows a widget. If the widget is an unmapped toplevel widget (i.e. a Gtk::Window that has not yet been shown), enter the main loop and wait for the window to actually be mapped. Be careful; because the main loop is running, anything can happen during this function. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This function is only used by Gtk::Container subclasses, to assign a size and position to their child widgets.
|
|
This function is typically used when implementing a Gtk::Container subclass. Obtains the preferred size of a widget. The container uses this information to arrange its child widgets and decide what size allocations to give them with size_allocate(). You can also call this function from an application, with some caveats. Most notably, getting a size request requires the widget to be associated with a screen, because font information may be needed. Multihead-aware applications should keep this in mind. Also remember that the size request is not necessarily the size a widget will actually be allocated. See also get_child_requisition().
|
|
Reverts the effect of a previous call to freeze_child_notify(). This causes all queued "child-notify" signals on widget to be emitted. |
|
Translate coordinates relative to src_widget 's allocation to coordinates relative to dest_widget 's allocations. In order to perform this operation, both widgets must be realized, and must share a common toplevel.
|
|
This function is only for use in widget implementations. Causes a widget to be unmapped if it's currently mapped. |
|
This function is only for use in widget implementations. Should be called by implementations of the remove method on Gtk::Container, to dissociate a child from the container. |
|
This function is only useful in widget implementations. Causes a widget to be unrealized (frees all GDK resources associated with the widget, such as widget ->window). |
|
|
|
|
|
|
|
|
|
|