gtkmm: Gtk::Widget Class Reference

Abstract Widget (Base class for all widgets) More...

Inheritance diagram for Gtk::Widget:

List of all members.

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.

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 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)
 Convenience function that calls queue_draw_region() on the region created from the given coordinates.

void queue_draw_region (const ::Cairo::RefPtr< const ::Cairo::Region >& region)
 Invalidates the rectangular area of widget defined by region by calling gdk_window_invalidate_region() on the widget's window and all its child windows.

void queue_resize ()
 This function is only for use in widget implementations.

void size_allocate (const Allocation& allocation)
 This function is only used by Gtk::Container subclasses, to assign a size and position to their child widgets.

SizeRequestMode get_request_mode () const
 Gets whether the widget prefers a height-for-width layout or a width-for-height layout.

void get_preferred_width (int& minimum_width, int& natural_width) const
 Retrieves a widget's initial minimum and natural width.

void get_preferred_height_for_width (int width, int& minimum_height, int& natural_height) const
 Retrieves a widget's minimum and natural height if it would be given the specified width.

void get_preferred_height (int& minimum_height, int& natural_height) const
 Retrieves a widget's initial minimum and natural height.

void get_preferred_width_for_height (int height, int& minimum_width, int& natural_width) const
 Retrieves a widget's minimum and natural width if it would be given the specified height.

void get_preferred_size (Requisition& minimum_size, Requisition& natural_size) const
 Retrieves the minimum and natural size of a widget, taking into account the widget's preference for height-for-width management.

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)
 Emits the Gtk::Widget::mnemonic-activate signal.

bool event (GdkEvent* event)
 Rarely-used function.

int send_expose (GdkEvent* event)
 Very rarely-used function.

bool send_focus_change (GdkEvent* event)
 Sends the focus change event to widget.

bool activate ()
 For widgets that can be "activated" (buttons, menu items, etc.) this function activates them.

void reparent (Widget& new_parent)
 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.

::Cairo::RefPtr< ::Cairo::Regionregion_intersect (const ::Cairo::RefPtr< ::Cairo::Region >& region) const
 Computes the intersection of a widget's area and region, returning the intersection.

void freeze_child_notify ()
 Stops emission of Gtk::Widget::child-notify signals on widget.

void child_notify (const Glib::ustring& child_property)
 Emits a Gtk::Widget::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().

void set_can_focus (bool can_focus=true)
 Specifies whether widget can own the input focus.

bool get_can_focus () const
 Determines whether widget can own the input focus.

bool has_focus () const
 Determines if the widget has the global input focus.

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 set_can_default (bool can_default=true)
 Specifies whether widget can be a default widget.

bool get_can_default () const
 Determines whether widget can be a default widget.

bool has_default () const
 Determines whether widget is the current default widget within its toplevel.

void grab_default ()
 Causes widget to become the default widget.

void set_receives_default (bool receives_default=true)
 Specifies whether widget will be treated as the default widget within its toplevel when it has the focus, even if another widget is the default.

bool get_receives_default () const
 Determines whether widget is alyways treated as default widget withing its toplevel when it has the focus, even if another widget is the default.

bool has_grab () const
 Determines whether the widget is currently grabbing events, so it is the only widget receiving input events (keyboard and mouse).

bool device_is_shadowed (const Glib::RefPtr< const Gdk::Device >& device)
 Returns true if device has been shadowed by a GTK+ device grab on another widget, so it would stop sending events to widget.

void add_modal_grab ()
 Block events to everything else than this widget and its children.

void remove_modal_grab ()
 Remove the modal grab of the widget in case it was previously grabbed.

void set_name (const Glib::ustring& name)
 Widgets can be named, which allows you to refer to them from a CSS file.

void unset_name ()
Glib::ustring get_name () const
 Retrieves the name of a widget.

void set_state (StateType state)
 This function is for use in widget implementations.

StateType get_state () const
 Returns the widget's state.

void set_state_flags (StateFlags flags, bool clear=true)
 This function is for use in widget implementations.

void unset_state_flags (StateFlags flags)
 This function is for use in widget implementations.

StateFlags get_state_flags () const
 Returns the widget state as a flag set.

void set_sensitive (bool sensitive=true)
 Sets the sensitivity of a widget.

bool get_sensitive () const
 Returns the widget's sensitivity (in the sense of returning the value that has been set using set_sensitive()).

bool is_sensitive () const
 Returns the widget's effective sensitivity, which means it is sensitive itself and also its parent widget is sensitive.

void set_visible (bool visible=true)
 Sets the visibility state of widget.

bool get_visible () const
 Determines whether the widget is visible.

bool get_has_window () const
 Determines whether widget has a Gdk::Window of its own.

bool get_is_toplevel () const
 Determines whether widget is a toplevel widget.

bool get_is_drawable () const
 Determines whether widget can be drawn to.

bool get_realized () const
 Determines whether widget is realized.

bool get_mapped () const
 Whether the widget is mapped.

void set_app_paintable (bool app_paintable=true)
 Sets whether the application intends to draw on the widget in an Gtk::Widget::draw handler.

bool get_app_paintable () const
 Determines whether the application intends to draw on the widget in an Gtk::Widget::draw handler.

void set_double_buffered (bool double_buffered=true)
 Widgets are double buffered by default; you can use this function to turn off the buffering.

bool get_double_buffered () const
 Determines whether the widget is double buffered.

void set_redraw_on_allocate (bool redraw_on_allocate=true)
 Sets whether the entire widget is queued for drawing when its size allocation changes.

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().

Glib::RefPtr< Gdk::Windowget_window ()
 Returns the widget's window if it is realized, 0 otherwise.

Glib::RefPtr< const Gdk::Windowget_window () const
 Returns the widget's window if it is realized, 0 otherwise.

int get_allocated_width () const
 Returns the width that has currently been allocated to widget.

int get_allocated_height () const
 Returns the height that has currently been allocated to widget.

Allocation get_allocation () const
 Retrieves the widget's location.

void set_allocation (const Allocation& allocation)
 Sets the widget's allocation.

Containerget_parent ()
 Returns the parent container of widget.

const Containerget_parent () const
 Returns the parent container of widget.

Glib::RefPtr< Gdk::Windowget_parent_window ()
 Gets widget's parent window.

Glib::RefPtr< const Gdk::Windowget_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.

bool keynav_failed (DirectionType direction)
 This function should be called whenever keyboard navigation within a single widget hits a boundary.

void error_bell ()
 Notifies the user about an input-related error on this widget.

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_device_events (const Glib::RefPtr< const Gdk::Device >& device, Gdk::EventMask events)
 Sets the device event mask (see Gdk::EventMask) for a widget.

void add_device_events (const Glib::RefPtr< const Gdk::Device >& device, Gdk::EventMask events)
 Adds the device events in the bitfield events to the event mask for widget.

void set_device_enabled (const Glib::RefPtr< Gdk::Device >& device, bool enabled=true)
 Enables or disables a Gdk::Device to interact with widget and all its children.

bool get_device_enabled (const Glib::RefPtr< const Gdk::Device >& device) const
 Returns whether device can interact with widget and its children.

Containerget_toplevel ()
 This function returns the topmost widget in the container hierarchy widget is a part of.

const Containerget_toplevel () const
 This function returns the topmost widget in the container hierarchy widget is a part of.

Widgetget_ancestor (GType widget_type)
 Gets the first ancestor of widget with type widget_type.

const Widgetget_ancestor (GType widget_type) const
 Gets the first ancestor of widget with type widget_type.

Glib::RefPtr< Gdk::Visualget_visual ()
 Gets the visual that will be used to render widget.

Glib::RefPtr< Gdk::Screenget_screen ()
 Get the Gdk::Screen from the toplevel window associated with this widget.

Glib::RefPtr< const Gdk::Screenget_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::Displayget_display ()
 Get the Gdk::Display for the toplevel window associated with this widget.

Glib::RefPtr< const Gdk::Displayget_display () const
 Get the Gdk::Display for the toplevel window associated with this widget.

Glib::RefPtr< Gdk::Windowget_root_window ()
 Get the root window where this widget is located.

Glib::RefPtr< const Gdk::Windowget_root_window () const
 Get the root window where this widget is located.

Glib::RefPtr< Settingsget_settings ()
 Gets the settings object holding the settings used for this widget.

Glib::RefPtr< Clipboardget_clipboard (const Glib::ustring& selection)
 Returns the clipboard object for the given selection to be used with widget.

Glib::RefPtr< const Clipboardget_clipboard (const Glib::ustring& selection) const
 Returns the clipboard object for the given selection to be used with widget.

bool get_hexpand () const
 Gets whether the widget would like any available extra horizontal space.

void set_hexpand (bool expand=true)
 Sets whether the widget would like any available extra horizontal space.

bool get_hexpand_set () const
 Gets whether set_hexpand() has been used to explicitly set the expand flag on this widget.

void set_hexpand_set (bool set=true)
 Sets whether the hexpand flag (see get_hexpand()) will be used.

bool get_vexpand () const
 Gets whether the widget would like any available extra vertical space.

void set_vexpand (bool expand=true)
 Sets whether the widget would like any available extra vertical space.

bool get_vexpand_set () const
 Gets whether set_vexpand() has been used to explicitly set the expand flag on this widget.

void set_vexpand_set (bool set=true)
 Sets whether the vexpand flag (see get_vexpand()) will be used.

void queue_compute_expand ()
 Mark widget as needing to recompute its expand flags.

bool compute_expand (Orientation orientation)
 Computes whether a container should give this widget extra space when possible.

bool get_support_multidevice () const
 Returns true if widget is multiple pointer aware.

void set_support_multidevice (bool support_multidevice=true)
 Enables or disables multiple pointer awareness.

Glib::RefPtr< Atk::Objectget_accessible ()
 Returns the accessible object that describes the widget to an assistive technology.

Glib::RefPtr< const Atk::Objectget_accessible () const
 Returns the accessible object that describes the widget to an assistive technology.

Align get_halign () const
 Gets the value of the Gtk::Widget:halign property.

void set_halign (Align align)
 Sets the horizontal alignment of widget.

Align get_valign () const
 Gets the value of the Gtk::Widget:valign property.

void set_valign (Align align)
 Sets the vertical alignment of widget.

int get_margin_left () const
 Gets the value of the Gtk::Widget:margin-left property.

void set_margin_left (int margin)
 Sets the left margin of widget.

int get_margin_right () const
 Gets the value of the Gtk::Widget:margin-right property.

void set_margin_right (int margin)
 Sets the right margin of widget.

int get_margin_top () const
 Gets the value of the Gtk::Widget:margin-top property.

void set_margin_top (int margin)
 Sets the top margin of widget.

int get_margin_bottom () const
 Gets the value of the Gtk::Widget:margin-bottom property.

void set_margin_bottom (int margin)
 Sets the bottom margin of widget.

Gdk::EventMask get_events () const
 Returns the event mask for the widget (a bitfield containing flags from the Gdk::EventMask enumeration).

Gdk::EventMask get_device_events (const Glib::RefPtr< const Gdk::Device >& device) const
 Returns the events mask for the widget corresponding to an specific device.

void get_pointer (int& x, int& y) const
 Obtains the location of the mouse pointer in widget coordinates.

bool is_ancestor (Widget& ancestor) const
 Determines whether widget is somewhere inside ancestor, possibly with intermediate containers.

bool translate_coordinates (Widget& dest_widget, int src_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 override_color (const Gdk::RGBA& color, StateFlags state=(StateFlags) 0)
void unset_color (StateFlags state=(StateFlags) 0)
void override_background_color (const Gdk::RGBA& color, StateFlags state=(StateFlags) 0)
void unset_background_color (StateFlags state=(StateFlags) 0)
void override_font (const Pango::FontDescription& font_desc)
 Sets the font to use for a widget.

void unset_font ()
void override_symbolic_color (const Glib::ustring& name, const Gdk::RGBA& color)
 Sets a symbolic color for a widget.

void unset_symbolic_color (const Glib::ustring& name)
void override_cursor (const Gdk::RGBA& cursor, const Gdk::RGBA& secondary_cursor)
 Sets the cursor color to use in a widget, overriding the Gtk::Widget:cursor-color and Gtk::Widget:secondary-cursor-color style properties.

void unset_cursor ()
void reset_style ()
 Updates the style context of widget and all descendents by updating its widget path.

template<class PropertyType >
void get_style_property (const Glib::ustring& the_property_name, PropertyType&value) const
Glib::RefPtr< Pango::Contextcreate_pango_context ()
 Creates a new Pango::Context with the appropriate font map, font description, and base direction for drawing text for this widget.

Glib::RefPtr< Pango::Contextget_pango_context ()
 Gets a Pango::Context with the appropriate font map, font description, and base direction for this widget.

Glib::RefPtr< Pango::Layoutcreate_pango_layout (const Glib::ustring& text)
 Creates a new Pango::Layout with the appropriate font map, font description, and base direction for drawing text for this widget.

Glib::RefPtr< Gdk::Pixbufrender_icon_pixbuf (const StockID& stock_id, IconSize size)
 A convenience function that uses the theme engine and style 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 set_direction (TextDirection dir)
 Sets the reading direction on a particular widget.

TextDirection get_direction () const
 Gets the reading direction for a particular widget.

void shape_combine_region (const ::Cairo::RefPtr< const ::Cairo::Region >& region)
 Sets a shape for this widget's GDK window.

void input_shape_combine_region (const ::Cairo::RefPtr< const ::Cairo::Region >& region)
 Sets an input shape for this widget's GDK window.

WidgetPath get_path () const
 Returns the Gtk::WidgetPath representing widget, if the widget is not connected to a toplevel widget, a partial path will be created.

std::vector< Widget* > list_mnemonic_labels ()
 Returns a newly allocated list of the widgets, normally labels, for which this widget is the target of a mnemonic (see for example, Gtk::Label::set_mnemonic_widget()).

std::vector< const Widget* > list_mnemonic_labels () const
 Returns a newly allocated list of the widgets, normally labels, for which this widget is the target of a mnemonic (see for example, Gtk::Label::set_mnemonic_widget()).

void add_mnemonic_label (Widget& label)
 Adds a widget to the list of mnemonic labels for this widget.

void remove_mnemonic_label (Widget& label)
 Removes a widget from the list of mnemonic labels for this widget.

void drag_get_data (const Glib::RefPtr< Gdk::DragContext >& context, const Glib::ustring& target, guint32 time)
 Gets the data associated with a drag.

void drag_highlight ()
 Draws a highlight around a widget.

void drag_unhighlight ()
 Removes a highlight set by gtk_drag_highlight() from a widget.

void drag_dest_set (DestDefaults flags=DestDefaults(0), Gdk::DragAction actions=Gdk::DragAction(0))
void drag_dest_set (const std::vector< 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)
 Sets this widget as a proxy for drops to another window.

void drag_dest_unset ()
 Clears information about a drop destination set with gtk_drag_dest_set().

Glib::ustring drag_dest_find_target (const Glib::RefPtr< Gdk::DragContext >& context, const Glib::RefPtr< TargetList >& target_list) const
 Looks for a match between context->targets and the dest_target_list, returning the first matching target, otherwise returning Gdk::NONE.

Glib::ustring drag_dest_find_target (const Glib::RefPtr< Gdk::DragContext >& context) const
Glib::RefPtr< TargetListdrag_dest_get_target_list ()
 Returns the list of targets this widget can accept from drag-and-drop.

Glib::RefPtr< const TargetListdrag_dest_get_target_list () const
 Returns the list of targets this widget can accept from drag-and-drop.

void drag_dest_set_target_list (const Glib::RefPtr< TargetList >& target_list)
 Sets the target types that this widget can accept from drag-and-drop.

void drag_dest_add_text_targets ()
 Add the text targets supported by Gtk::Selection to the target list of the drag destination.

void drag_dest_add_image_targets ()
 Add the image targets supported by Gtk::Selection to the target list of the drag destination.

void drag_dest_add_uri_targets ()
 Add the URI targets supported by Gtk::Selection to the target list of the drag destination.

void drag_source_set (const std::vector< TargetEntry >& targets, Gdk::ModifierType start_button_mask=Gdk::MODIFIER_MASK, Gdk::DragAction actions=Gdk::ACTION_COPY)
void drag_source_unset ()
 Undoes the effects of set().

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 StockID& stock_id)
 Sets the icon that will be used for drags from a particular source to a stock icon.

void drag_source_set_icon (const Glib::ustring& icon_name)
 Sets the icon that will be used for drags from a particular source to a themed icon.

void drag_source_add_text_targets ()
 Add the text targets supported by Gtk::Selection to the target list of the drag source.

void drag_source_add_uri_targets ()
 Add the URI targets supported by Gtk::Selection to the target list of the drag source.

void drag_source_add_image_targets ()
 Add the writable image targets supported by Gtk::Selection to the target list of the drag source.

Glib::RefPtr< Gdk::DragContextdrag_begin (const Glib::RefPtr< TargetList >& targets, Gdk::DragAction actions, int button, GdkEvent* event)
 Initiates a drag on the source side.

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 threshold, 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)
void queue_resize_no_redraw ()
 This function works like queue_resize(), except that the widget is not invalidated.

bool get_no_show_all () const
 Returns the current value of the Gtk::Widget:no-show-all property, which determines whether calls to show_all() will affect this widget.

void set_no_show_all (bool no_show_all=true)
 Sets the Gtk::Widget:no-show-all property, which determines whether calls to show_all() will affect this widget.

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 map ()
 This function is only for use in widget implementations.

void unmap ()
 This function is only for use in widget implementations.

void draw_insertion_cursor (const ::Cairo::RefPtr< ::Cairo::Context >& cr, const Gdk::Rectangle& location, bool is_primary, TextDirection direction, bool draw_arrow=true)
void set_tooltip_window (Window& widget)
 Replaces the default, usually yellow, window used for displaying tooltips with custom_window.

Windowget_tooltip_window ()
 Returns the Gtk::Window of the current tooltip.

void trigger_tooltip_query ()
 Triggers a tooltip query on the display where the toplevel of widget is located.

void set_tooltip_text (const Glib::ustring& text)
 Sets text as the contents of the tooltip.

Glib::ustring get_tooltip_text () const
 Gets the contents of the tooltip for widget.

void set_tooltip_markup (const Glib::ustring& markup)
 Sets markup as the contents of the tooltip, which is marked up with the Pango text markup language.

Glib::ustring get_tooltip_markup () const
 Gets the contents of the tooltip for widget.

void set_has_tooltip (bool has_tooltip=TRUE)
 Sets the has-tooltip property on widget to has_tooltip.

bool get_has_tooltip () const
 Returns the current value of the has-tooltip property.

int get_width () const
int get_height () const
bool is_composited () const
 Whether widget can rely on having its alpha channel drawn correctly.

bool in_destruction () const
 Returns whether the widget is currently being destroyed.

Glib::RefPtr< StyleContextget_style_context ()
 Returns the style context associated to widget.

Glib::RefPtr< Gtk::StyleContextget_style_context () const
 Returns the style context associated to widget.

Glib::SignalProxy0< void > signal_show ()
Glib::SignalProxy0< void > signal_hide ()
Glib::SignalProxy0< void > signal_map ()
 Emitted on mapping of a widget to the screen.

Glib::SignalProxy0< void > signal_unmap ()
Glib::SignalProxy0< void > signal_realize ()
 Emitted on realization of a widget.

Glib::SignalProxy0< void > signal_unrealize ()
Glib::SignalProxy1< void,

Allocation& > 
signal_size_allocate ()
Glib::SignalProxy1< void,

Gtk::StateType
signal_state_changed ()
Glib::SignalProxy1< void,

Widget* > 
signal_parent_changed ()
 Informs objects that their parent changed.

Glib::SignalProxy1< void,

Widget* > 
signal_hierarchy_changed ()
Glib::SignalProxy0< void > signal_style_updated ()
Glib::SignalProxy1< void,

TextDirection
signal_direction_changed ()
Glib::SignalProxy1< void, bool > signal_grab_notify ()
Glib::SignalProxy1< void,

GParamSpec* > 
signal_child_notify ()
 The ::child-notify signal is emitted for each child property that has changed on an object.

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< void,

GdkEvent* > 
signal_event_after ()
Glib::SignalProxy1< bool,

GdkEventButton* > 
signal_button_press_event ()
 Event triggered by user pressing button.

Glib::SignalProxy1< bool,

GdkEventButton* > 
signal_button_release_event ()
 Event triggered by user releasing button.

Glib::SignalProxy1< bool,

GdkEventScroll* > 
signal_scroll_event ()
Glib::SignalProxy1< bool,

GdkEventMotion* > 
signal_motion_notify_event ()
 Event triggered by user moving pointer.

Glib::SignalProxy1< bool,

GdkEventAny* > 
signal_delete_event ()
 The delete_event signal is emitted if a user requests that a toplevel window is closed.

Glib::SignalProxy1< bool,

const ::Cairo::RefPtr

< ::Cairo::Context >& > 
signal_draw ()
Glib::SignalProxy1< bool,

GdkEventKey* > 
signal_key_press_event ()
 Event triggered by a key press will widget has focus.

Glib::SignalProxy1< bool,

GdkEventKey* > 
signal_key_release_event ()
 Event triggered by a key release will widget has focus.

Glib::SignalProxy1< bool,

GdkEventCrossing* > 
signal_enter_notify_event ()
 Event triggered by pointer entering widget area.

Glib::SignalProxy1< bool,

GdkEventCrossing* > 
signal_leave_notify_event ()
 Event triggered by pointer leaving widget area.

Glib::SignalProxy1< bool,

GdkEventConfigure* > 
signal_configure_event ()
 Event triggered by a window resizing.

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,

GdkEventWindowState* > 
signal_window_state_event ()
Glib::SignalProxy3< void,

SelectionData&, guint, guint > 
signal_selection_get ()
Glib::SignalProxy2< void,

const SelectionData&, guint > 
signal_selection_received ()
Glib::SignalProxy1< void,

const Glib::RefPtr

< Gdk::DragContext >& > 
signal_drag_begin ()
 The drag_begin signal is emitted on the drag source when a drag is started.

Glib::SignalProxy1< void,

const Glib::RefPtr

< Gdk::DragContext >& > 
signal_drag_end ()
 The drag_end signal is emitted on the drag source when a drag is finished.

Glib::SignalProxy4< void,

const Glib::RefPtr

< Gdk::DragContext >

&, SelectionData&, guint,

guint > 
signal_drag_data_get ()
 The drag_data_get signal is emitted on the drag source when the drop site requests the data which is dragged.

Glib::SignalProxy1< void,

const Glib::RefPtr

< Gdk::DragContext >& > 
signal_drag_data_delete ()
 The drag_data_delete signal is emitted on the drag source when a drag with the action Gdk::ACTION_MOVE is successfully completed.

Glib::SignalProxy2< bool,

const Glib::RefPtr

< Gdk::DragContext >

&, DragResult
signal_drag_failed ()
Glib::SignalProxy2< void,

const Glib::RefPtr

< Gdk::DragContext >&, guint > 
signal_drag_leave ()
 The drag_leave signal is emitted on the drop site when the cursor leaves the widget.

Glib::SignalProxy4< bool,

const Glib::RefPtr

< Gdk::DragContext >&, int,

int, guint > 
signal_drag_motion ()
 The drag_motion signal is emitted on the drop site when the user moves the cursor over the widget during a drag.

Glib::SignalProxy4< bool,

const Glib::RefPtr

< Gdk::DragContext >&, int,

int, guint > 
signal_drag_drop ()
 The drag_drop signal is emitted on the drop site when the user drops the data onto the widget.

Glib::SignalProxy6< void,

const Glib::RefPtr

< Gdk::DragContext >&, int,

int, const SelectionData

&, guint, guint > 
signal_drag_data_received ()
 The drag_data_received signal is emitted on the drop site when the dragged data has been received.

Glib::SignalProxy1< void,

const Glib::RefPtr

< Gdk::Screen >& > 
signal_screen_changed ()
Glib::SignalProxy0< void > signal_composited_changed ()
Glib::SignalProxy0< bool > signal_popup_menu ()
Glib::SignalProxy4< bool, int,

int, bool, const Glib::RefPtr

< Tooltip >& > 
signal_query_tooltip ()
Glib::SignalProxy1< bool,

GdkEventGrabBroken* > 
signal_grab_broken_event ()
Glib::SignalProxy1< bool,

GdkEventExpose* > 
signal_damage_event ()
Glib::PropertyProxy

< Glib::ustring
property_name ()
 The name of the widget.

Glib::PropertyProxy_ReadOnly

< Glib::ustring
property_name () const
 The name of the widget.

Glib::PropertyProxy< Container* > property_parent ()
 The parent widget of this widget.

Glib::PropertyProxy_ReadOnly

< Container* > 
property_parent () const
 The parent widget of this widget.

Glib::PropertyProxy< int > property_width_request ()
 Override for width request of the widget, or -1 if natural request should be used.

Glib::PropertyProxy_ReadOnly< int > property_width_request () const
 Override for width request of the widget, or -1 if natural request should be used.

Glib::PropertyProxy< int > property_height_request ()
 Override for height request of the widget, or -1 if natural request should be used.

Glib::PropertyProxy_ReadOnly< int > property_height_request () const
 Override for height request of the widget, or -1 if natural request should be used.

Glib::PropertyProxy< bool > property_visible ()
 Whether the widget is visible.

Glib::PropertyProxy_ReadOnly

< bool > 
property_visible () const
 Whether the widget is visible.

Glib::PropertyProxy< bool > property_sensitive ()
 Whether the widget responds to input.

Glib::PropertyProxy_ReadOnly

< bool > 
property_sensitive () const
 Whether the widget responds to input.

Glib::PropertyProxy< bool > property_app_paintable ()
 Whether the application will paint directly on the widget.

Glib::PropertyProxy_ReadOnly

< bool > 
property_app_paintable () const
 Whether the application will paint directly on the widget.

Glib::PropertyProxy< bool > property_can_focus ()
 Whether the widget can accept the input focus.

Glib::PropertyProxy_ReadOnly

< bool > 
property_can_focus () const
 Whether the widget can accept the input focus.

Glib::PropertyProxy< bool > property_has_focus ()
 Whether the widget has the input focus.

Glib::PropertyProxy_ReadOnly

< bool > 
property_has_focus () const
 Whether the widget has the input focus.

Glib::PropertyProxy< bool > property_is_focus ()
 Whether the widget is the focus widget within the toplevel.

Glib::PropertyProxy_ReadOnly

< bool > 
property_is_focus () const
 Whether the widget is the focus widget within the toplevel.

Glib::PropertyProxy< bool > property_can_default ()
 Whether the widget can be the default widget.

Glib::PropertyProxy_ReadOnly

< bool > 
property_can_default () const
 Whether the widget can be the default widget.

Glib::PropertyProxy< bool > property_has_default ()
 Whether the widget is the default widget.

Glib::PropertyProxy_ReadOnly

< bool > 
property_has_default () const
 Whether the widget is the default widget.

Glib::PropertyProxy< bool > property_receives_default ()
 If TRUE, the widget will receive the default action when it is focused.

Glib::PropertyProxy_ReadOnly

< bool > 
property_receives_default () const
 If TRUE, the widget will receive the default action when it is focused.

Glib::PropertyProxy_ReadOnly

< bool > 
property_composite_child () const
 Whether the widget is part of a composite widget.

Glib::PropertyProxy

< Glib::RefPtr< Style > > 
property_style ()
 The style of the widget, which contains information about how it will look (colors etc).

Glib::PropertyProxy_ReadOnly

< Glib::RefPtr< Style > > 
property_style () const
 The style of the widget, which contains information about how it will look (colors etc).

Glib::PropertyProxy

< Gdk::EventMask
property_events ()
 The event mask that decides what kind of GdkEvents this widget gets.

Glib::PropertyProxy_ReadOnly

< Gdk::EventMask
property_events () const
 The event mask that decides what kind of GdkEvents this widget gets.

Glib::PropertyProxy< bool > property_has_tooltip ()
 Whether this widget has a tooltip.

Glib::PropertyProxy_ReadOnly

< bool > 
property_has_tooltip () const
 Whether this widget has a tooltip.

Glib::PropertyProxy

< Glib::ustring
property_tooltip_markup ()
 The contents of the tooltip for this widget.

Glib::PropertyProxy_ReadOnly

< Glib::ustring
property_tooltip_markup () const
 The contents of the tooltip for this widget.

Glib::PropertyProxy

< Glib::ustring
property_tooltip_text ()
 The contents of the tooltip for this widget.

Glib::PropertyProxy_ReadOnly

< Glib::ustring
property_tooltip_text () const
 The contents of the tooltip for this widget.

Glib::PropertyProxy_ReadOnly

< Glib::RefPtr< Gdk::Window > > 
property_window () const
 The widget's window if it is realized.

Glib::PropertyProxy< bool > property_no_show_all ()
 Whether gtk_widget_show_all() should not affect this widget.

Glib::PropertyProxy_ReadOnly

< bool > 
property_no_show_all () const
 Whether gtk_widget_show_all() should not affect this widget.

Glib::PropertyProxy< bool > property_double_buffered ()
 Whether the widget is double buffered.

Glib::PropertyProxy_ReadOnly

< bool > 
property_double_buffered () const
 Whether the widget is double buffered.

Glib::PropertyProxy< Alignproperty_halign ()
 How to position in extra horizontal space.

Glib::PropertyProxy_ReadOnly

< Align
property_halign () const
 How to position in extra horizontal space.

Glib::PropertyProxy< Alignproperty_valign ()
 How to position in extra vertical space.

Glib::PropertyProxy_ReadOnly

< Align
property_valign () const
 How to position in extra vertical space.

Glib::PropertyProxy< int > property_margin_left ()
 Pixels of extra space on the left side.

Glib::PropertyProxy_ReadOnly< int > property_margin_left () const
 Pixels of extra space on the left side.

Glib::PropertyProxy< int > property_margin_right ()
 Pixels of extra space on the right side.

Glib::PropertyProxy_ReadOnly< int > property_margin_right () const
 Pixels of extra space on the right side.

Glib::PropertyProxy< int > property_margin_top ()
 Pixels of extra space on the top side.

Glib::PropertyProxy_ReadOnly< int > property_margin_top () const
 Pixels of extra space on the top side.

Glib::PropertyProxy< int > property_margin_bottom ()
 Pixels of extra space on the bottom side.

Glib::PropertyProxy_ReadOnly< int > property_margin_bottom () const
 Pixels of extra space on the bottom side.

Glib::PropertyProxy< int > property_margin ()
 Pixels of extra space on all four sides.

Glib::PropertyProxy_ReadOnly< int > property_margin () const
 Pixels of extra space on all four sides.

Glib::PropertyProxy< bool > property_hexpand ()
 Whether widget wants more horizontal space.

Glib::PropertyProxy_ReadOnly

< bool > 
property_hexpand () const
 Whether widget wants more horizontal space.

Glib::PropertyProxy< bool > property_hexpand_set ()
 Whether to use the hexpand property.

Glib::PropertyProxy_ReadOnly

< bool > 
property_hexpand_set () const
 Whether to use the hexpand property.

Glib::PropertyProxy< bool > property_vexpand ()
 Whether widget wants more vertical space.

Glib::PropertyProxy_ReadOnly

< bool > 
property_vexpand () const
 Whether widget wants more vertical space.

Glib::PropertyProxy< bool > property_vexpand_set ()
 Whether to use the vexpand property.

Glib::PropertyProxy_ReadOnly

< bool > 
property_vexpand_set () const
 Whether to use the vexpand property.

Glib::PropertyProxy< bool > property_expand ()
 Whether widget wants to expand in both directions.

Glib::PropertyProxy_ReadOnly

< bool > 
property_expand () const
 Whether widget wants to expand in both directions.

Static Public Member Functions

static Widgetget_current_modal_grab ()
 Retrieve the widget which is currently grabbing all events.

static void push_composite_child ()
 Makes all newly-created widgets as composite children until the corresponding pop_composite_child() call.

static void pop_composite_child ()
 Cancels the effect of a previous call to push_composite_child().

static void set_default_direction (TextDirection dir)
 Sets the default reading direction for widgets where the direction has not been explicitly set by set_direction().

static TextDirection get_default_direction ()
 Obtains the current default reading direction.

static Widgetdrag_get_source_widget (const Glib::RefPtr< Gdk::DragContext >& context)

Protected Member Functions

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_allocate (Allocation& 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_updated ()
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_draw (const ::Cairo::RefPtr< ::Cairo::Context >& cr)
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_window_state_event (GdkEventWindowState* event)
virtual void on_selection_get (SelectionData& selection_data, guint info, guint time)
virtual void on_selection_received (const SelectionData& 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, SelectionData& 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, const SelectionData& selection_data, guint info, guint time)
virtual void on_screen_changed (const Glib::RefPtr< Gdk::Screen >& previous_screen)
virtual void dispatch_child_properties_changed_vfunc (guint p1, GParamSpec** p2)
virtual void show_all_vfunc ()
virtual Glib::RefPtr< Atk::Objectget_accessible_vfunc ()
virtual SizeRequestMode get_request_mode_vfunc () const
virtual void get_preferred_width_vfunc (int& minimum_width, int& natural_width) const
virtual void get_preferred_height_for_width_vfunc (int width, int& minimum_height, int& natural_height) const
virtual void get_preferred_height_vfunc (int& minimum_height, int& natural_height) const
virtual void get_preferred_width_for_height_vfunc (int height, int& minimum_width, int& natural_width) const
 Widget ()
void realize ()
 Creates the GDK (windowing system) resources associated with a widget.

void unrealize ()
 This function is only useful in widget implementations.

void set_mapped (bool mapped=true)
 Marks the widget as being realized.

void set_realized (bool realized=true)
 Marks the widget as being realized.

void set_has_window (bool has_window=true)
 Specifies whether widget has a Gdk::Window of its own.

void set_window (const Glib::RefPtr< Gdk::Window >& window)
 Sets a widget's window.

void transform_cairo_context_to_window (const ::Cairo::RefPtr< ::Cairo::Context >& cr, const Glib::RefPtr< const Gdk::Window >& window)
 Transforms the given cairo context cr from widget-relative coordinates to window-relative coordinates.

Requisition get_requisition () const
 Retrieves the widget's requisition.

void get_style_property_value (const Glib::ustring& the_property_name, Glib::ValueBase&value) const
 Gets the value of a style property of widget.

void realize_if_needed ()

Static Protected Member Functions

static bool should_draw_window (const ::Cairo::RefPtr< const ::Cairo::Context >& cr, const Glib::RefPtr< const Gdk::Window >& window)
 This function is supposed to be called in Gtk::Widget::draw implementations for widgets that support multiple windows.

Related Functions

(Note that these are not member functions.)

Gtk::Widgetwrap (GtkWidget* object, bool take_copy=false)
 A Glib::wrap() method for this object.


Detailed Description

Abstract Widget (Base class for all widgets)

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 ().

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.


Constructor & Destructor Documentation

virtual Gtk::Widget::~Widget ( ) [virtual]
Gtk::Widget::Widget ( ) [protected]

Member Function Documentation

bool Gtk::Widget::activate ( )

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. If widget isn't activatable, the function returns false.

Returns:
true if the widget was activatable.

Reimplemented in Gtk::MenuItem.

void Gtk::Widget::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.

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 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::AccelMap::add_entry() and set_accel_path() or Gtk::MenuItem::set_accel_path() instead.

Parameters:
accel_signalWidget signal to emit on accelerator activation.
accel_groupAccel group for this widget, added to its toplevel.
accel_keyGDK keyval of the accelerator.
accel_modsModifier key combination of the accelerator.
accel_flagsFlag accelerators, e.g. Gtk::ACCEL_VISIBLE.
void Gtk::Widget::add_device_events ( const Glib::RefPtr< const Gdk::Device >&  device,
Gdk::EventMask  events 
)

Adds the device events in the bitfield events to the event mask for widget.

See set_device_events() for details.

Since gtkmm 3.0:
Parameters:
deviceA Gdk::Device.
eventsAn event mask, see Gdk::EventMask.
void Gtk::Widget::add_events ( Gdk::EventMask  events)

Adds the events in the bitfield events to the event mask for widget.

See set_events() for details.

Parameters:
eventsAn event mask, see Gdk::EventMask.
void Gtk::Widget::add_mnemonic_label ( Widget label)

Adds a widget to the list of mnemonic labels for this widget.

(See list_mnemonic_labels()). Note the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update its internal state at this point as well.

Since gtkmm 2.4:
Parameters:
labelA Gtk::Widget that acts as a mnemonic label for widget.
void Gtk::Widget::add_modal_grab ( )

Block events to everything else than this widget and its children.

This way you can get modal behaviour (usually not recommended). One practical example could be when implementing a key-binding widget that needs exclusive access to the key combination that the user presses next.

Calls to add_modal_grab should be paired with calls to remove_modal_grab.

bool Gtk::Widget::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.

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() emits the Gtk::Widget::focus signal; widgets override the default handler for this signal in order to implement appropriate focus behavior.

The default ::focus handler for a widget should return true if moving in direction left the focus on a focusable location inside that widget, and false if moving in direction moved the focus outside the widget. If returning true, widgets normally call grab_focus() to place the focus accordingly; if returning false, they don't modify the current focus location.

Parameters:
directionDirection of focus movement.
Returns:
true if focus ended up inside widget.
void Gtk::Widget::child_notify ( const Glib::ustring child_property)

Emits a Gtk::Widget::child-notify signal for the child property child_property on widget.

This is the analogue of Glib::object_notify() for child properties.

Also see Gtk::Container::child_notify().

Parameters:
child_propertyThe name of a child property installed on the class of widget's parent.
bool Gtk::Widget::compute_expand ( Orientation  orientation)

Computes whether a container should give this widget extra space when possible.

Containers should check this, rather than looking at get_hexpand() or get_vexpand().

This function already checks whether the widget is visible, so visibility does not need to be checked separately. Non-visible widgets are not expanded.

The computed expand value uses either the expand setting explicitly set on the widget itself, or, if none has been explicitly set, the widget may expand if some of its children do.

Parameters:
orientationExpand direction.
Returns:
Whether widget tree rooted here should be expanded.
Glib::RefPtr<Pango::Context> Gtk::Widget::create_pango_context ( )

Creates a new Pango::Context with the appropriate font map, font description, and base direction for drawing text for this widget.

See also get_pango_context().

Returns:
The new Pango::Context.
Glib::RefPtr<Pango::Layout> Gtk::Widget::create_pango_layout ( const Glib::ustring text)

Creates a new Pango::Layout with the appropriate font map, font description, and base direction for drawing text for this widget.

If you keep a Pango::Layout created in this way around, in order to 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 Gtk::Widget::style-updated and Gtk::Widget::direction-changed signals for the widget.

Parameters:
textText to set on the layout (can be 0).
Returns:
The new Pango::Layout.
bool Gtk::Widget::device_is_shadowed ( const Glib::RefPtr< const Gdk::Device >&  device)

Returns true if device has been shadowed by a GTK+ device grab on another widget, so it would stop sending events to widget.

This may be used in the Gtk::Widget::grab-notify signal to check for specific devices. See gtk_device_grab_add().

Since gtkmm 3.0:
Parameters:
deviceA Gdk::Device.
Returns:
true if there is an ongoing grab on device by another Gtk::Widget than widget.
virtual void Gtk::Widget::dispatch_child_properties_changed_vfunc ( guint  p1,
GParamSpec **  p2 
) [protected, virtual]
Glib::RefPtr<Gdk::DragContext> Gtk::Widget::drag_begin ( const Glib::RefPtr< TargetList >&  targets,
Gdk::DragAction  actions,
int  button,
GdkEvent *  event 
)

Initiates a drag on the source side.

The function only needs to be used when the application is starting drags itself, and is not needed when Gtk::DragSource::set() is used.

The event is used to retrieve the timestamp that will be used internally to grab the pointer. If event is #0, then GDK_CURRENT_TIME will be used. However, you should try to pass a real event in all cases, since that can be used by GTK+ to get information about the start position of the drag, for example if the event is a Gdk::MOTION_NOTIFY.

Generally there are three cases when you want to start a drag by hand by calling this function:

1. During a Gtk::Widget::button-press-event handler, if you want to start a drag immediately when the user presses the mouse button. Pass the event that you have in your Gtk::Widget::button-press-event handler.

2. During a Gtk::Widget::motion-notify-event handler, if you want to start a drag when the mouse moves past a certain threshold distance after a button-press. Pass the event that you have in your Gtk::Widget::motion-notify-event handler.

3. During a timeout handler, if you want to start a drag after the mouse button is held down for some time. Try to save the last event that you got from the mouse, using gdk_event_copy(), and pass it to this function (remember to free the event with gdk_event_free() when you are done). If you can really not pass a real event, pass #0 instead.

Parameters:
targetsThe targets (data formats) in which the source can provide the data.
actionsA bitmask of the allowed drag actions for this drag.
buttonThe button the user clicked to start the drag.
eventThe event that triggered the start of the drag.
Returns:
The context for this drag.
bool Gtk::Widget::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 threshold, and thus should trigger the beginning of a drag-and-drop operation.

Parameters:
start_xX coordinate of start of drag.
start_yY coordinate of start of drag.
current_xCurrent X coordinate.
current_yCurrent Y coordinate.
Returns:
true if the drag threshold has been passed.
void Gtk::Widget::drag_dest_add_image_targets ( )

Add the image targets supported by Gtk::Selection to the target list of the drag destination.

The targets are added with info = 0. If you need another value, use Gtk::TargetList::add_image_targets() and gtk_drag_dest_set_target_list().

Since gtkmm 2.6:
Parameters:
widgetA Gtk::Widget that's a drag destination.
void Gtk::Widget::drag_dest_add_text_targets ( )

Add the text targets supported by Gtk::Selection to the target list of the drag destination.

The targets are added with info = 0. If you need another value, use Gtk::TargetList::add_text_targets() and gtk_drag_dest_set_target_list().

Since gtkmm 2.6:
Parameters:
widgetA Gtk::Widget that's a drag destination.
void Gtk::Widget::drag_dest_add_uri_targets ( )

Add the URI targets supported by Gtk::Selection to the target list of the drag destination.

The targets are added with info = 0. If you need another value, use Gtk::TargetList::add_uri_targets() and gtk_drag_dest_set_target_list().

Since gtkmm 2.6:
Parameters:
widgetA Gtk::Widget that's a drag destination.
Glib::ustring Gtk::Widget::drag_dest_find_target ( const Glib::RefPtr< Gdk::DragContext >&  context,
const Glib::RefPtr< TargetList >&  target_list 
) const

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.

Parameters:
contextDrag context.
target_listList of droppable targets.
Returns:
First target that the source offers and the dest can accept, or Gdk::NONE.
Glib::ustring Gtk::Widget::drag_dest_find_target ( const Glib::RefPtr< Gdk::DragContext >&  context) const
Glib::RefPtr<TargetList> Gtk::Widget::drag_dest_get_target_list ( )

Returns the list of targets this widget can accept from drag-and-drop.

Returns:
The Gtk::TargetList, or 0 if none.
Glib::RefPtr<const TargetList> Gtk::Widget::drag_dest_get_target_list ( ) const

Returns the list of targets this widget can accept from drag-and-drop.

Returns:
The Gtk::TargetList, or 0 if none.
void Gtk::Widget::drag_dest_set ( const std::vector< TargetEntry >&  targets,
DestDefaults  flags = DEST_DEFAULT_ALL,
Gdk::DragAction  actions = Gdk::ACTION_COPY 
)
void Gtk::Widget::drag_dest_set ( DestDefaults  flags = DestDefaults(0),
Gdk::DragAction  actions = Gdk::DragAction(0) 
)
void Gtk::Widget::drag_dest_set_proxy ( const Glib::RefPtr< Gdk::Window >&  proxy_window,
Gdk::DragProtocol  protocol,
bool  use_coordinates 
)

Sets this widget as a proxy for drops to another window.

Parameters:
widgetA Gtk::Widget.
proxy_windowThe window to which to forward drag events.
protocolThe drag protocol which the proxy_window accepts (You can use gdk_drag_get_protocol() to determine this).
use_coordinatesIf true, send the same coordinates to the destination, because it is an embedded subwindow.
void Gtk::Widget::drag_dest_set_target_list ( const Glib::RefPtr< TargetList >&  target_list)

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().

Parameters:
target_listList of droppable targets, or 0 for none.
void Gtk::Widget::drag_dest_unset ( )

Clears information about a drop destination set with gtk_drag_dest_set().

The widget will no longer receive notification of drags.

Parameters:
widgetA Gtk::Widget.
void Gtk::Widget::drag_get_data ( const Glib::RefPtr< Gdk::DragContext >&  context,
const Glib::ustring target,
guint32  time 
)

Gets the data associated with a drag.

When the data is received or the retrieval fails, GTK+ will emit a Gtk::Widget::drag-data-received signal. Failure of the retrieval is indicated by the length field of the selection_data signal parameter being negative. However, when gtk_drag_get_data() is called implicitely because the Gtk::DEST_DEFAULT_DROP was set, then the widget will not receive notification of failed drops.

Parameters:
widgetThe widget that will receive the Gtk::Widget::drag-data-received signal.
contextThe drag context.
targetThe target (form of the data) to retrieve.
timeA timestamp for retrieving the data. This will generally be the time received in a Gtk::Widget::drag-motion" or Gtk::Widget::drag-drop" signal.
static Widget* Gtk::Widget::drag_get_source_widget ( const Glib::RefPtr< Gdk::DragContext >&  context) [static]
void Gtk::Widget::drag_highlight ( )

Draws a highlight around a widget.

This will attach handlers to Gtk::Widget::draw, so the highlight will continue to be displayed until gtk_drag_unhighlight() is called.

Parameters:
widgetA widget to highlight.
void Gtk::Widget::drag_set_as_icon ( const Glib::RefPtr< Gdk::DragContext >&  context,
int  hot_x,
int  hot_y 
)
void Gtk::Widget::drag_source_add_image_targets ( )

Add the writable image targets supported by Gtk::Selection to the target list of the drag source.

The targets are added with info = 0. If you need another value, use Gtk::TargetList::add_image_targets() and set_target_list().

Since gtkmm 2.6:
Parameters:
widgetA Gtk::Widget that's is a drag source.
void Gtk::Widget::drag_source_add_text_targets ( )

Add the text targets supported by Gtk::Selection to the target list of the drag source.

The targets are added with info = 0. If you need another value, use Gtk::TargetList::add_text_targets() and set_target_list().

Since gtkmm 2.6:
Parameters:
widgetA Gtk::Widget that's is a drag source.
void Gtk::Widget::drag_source_add_uri_targets ( )

Add the URI targets supported by Gtk::Selection to the target list of the drag source.

The targets are added with info = 0. If you need another value, use Gtk::TargetList::add_uri_targets() and set_target_list().

Since gtkmm 2.6:
Parameters:
widgetA Gtk::Widget that's is a drag source.
void Gtk::Widget::drag_source_set ( const std::vector< TargetEntry >&  targets,
Gdk::ModifierType  start_button_mask = Gdk::MODIFIER_MASK,
Gdk::DragAction  actions = Gdk::ACTION_COPY 
)
void Gtk::Widget::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.

GTK+ retains a reference for pixbuf and will release it when it is no longer needed.

Parameters:
pixbufThe Gdk::Pixbuf for the drag icon.
void Gtk::Widget::drag_source_set_icon ( const Glib::ustring icon_name)

Sets the icon that will be used for drags from a particular source to a themed icon.

See the docs for Gtk::IconTheme for more details.

Since gtkmm 2.8:
Parameters:
widgetA Gtk::Widget.
icon_nameName of icon to use.
void Gtk::Widget::drag_source_set_icon ( const StockID stock_id)

Sets the icon that will be used for drags from a particular source to a stock icon.

Parameters:
stock_idThe ID of the stock icon to use.
void Gtk::Widget::drag_source_unset ( )

Undoes the effects of set().

Parameters:
widgetA Gtk::Widget.
void Gtk::Widget::drag_unhighlight ( )

Removes a highlight set by gtk_drag_highlight() from a widget.

Parameters:
widgetA widget to remove the highlight from.
void Gtk::Widget::draw_insertion_cursor ( const ::Cairo::RefPtr< ::Cairo::Context > &  cr,
const Gdk::Rectangle location,
bool  is_primary,
TextDirection  direction,
bool  draw_arrow = true 
)
void Gtk::Widget::error_bell ( )

Notifies the user about an input-related error on this widget.

If the Gtk::Settings gtk-error-bell proeprty is true, it calls Gdk::Window::beep(), otherwise it does nothing.

Note that the effect of Gdk::Window::beep() can be configured in many ways, depending on the windowing backend and the desktop environment or window manager that is used.

Since gtkmm 2.12:
bool Gtk::Widget::event ( GdkEvent *  event)

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.

Parameters:
eventA Gdk::Event.
Returns:
Return from the event signal emission (true if the event was handled).
void Gtk::Widget::freeze_child_notify ( )

Stops emission of Gtk::Widget::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.

Glib::RefPtr<Atk::Object> Gtk::Widget::get_accessible ( )

Returns the accessible object that describes the widget to an assistive technology.

If no accessibility library is loaded (i.e. no ATK implementation library is loaded via <envar>GTK_MODULES</envar> or via another application library, such as libgnome), then this Atk::Object instance may be a no-op. Likewise, if no class-specific Atk::Object implementation is available for the widget instance in question, it will inherit an Atk::Object implementation from the first ancestor class for which such an implementation is defined.

The documentation of the ATK library contains more information about accessible objects and their uses.

Returns:
The Atk::Object associated with widget.
Glib::RefPtr<const Atk::Object> Gtk::Widget::get_accessible ( ) const

Returns the accessible object that describes the widget to an assistive technology.

If no accessibility library is loaded (i.e. no ATK implementation library is loaded via <envar>GTK_MODULES</envar> or via another application library, such as libgnome), then this Atk::Object instance may be a no-op. Likewise, if no class-specific Atk::Object implementation is available for the widget instance in question, it will inherit an Atk::Object implementation from the first ancestor class for which such an implementation is defined.

The documentation of the ATK library contains more information about accessible objects and their uses.

Returns:
The Atk::Object associated with widget.
virtual Glib::RefPtr<Atk::Object> Gtk::Widget::get_accessible_vfunc ( ) [protected, virtual]
int Gtk::Widget::get_allocated_height ( ) const

Returns the height that has currently been allocated to widget.

This function is intended to be used when implementing handlers for the Gtk::Widget::draw function.

Returns:
The height of the widget.
int Gtk::Widget::get_allocated_width ( ) const

Returns the width that has currently been allocated to widget.

This function is intended to be used when implementing handlers for the Gtk::Widget::draw function.

Returns:
The width of the widget.
Allocation Gtk::Widget::get_allocation ( ) const

Retrieves the widget's location.

Note, when implementing a Container: a widget's allocation will be its "adjusted" allocation, that is, the widget's parent container typically calls size_allocate() with an allocation, and that allocation is then adjusted (to handle margin and alignment for example) before assignment to the widget. get_allocation() returns the adjusted allocation that was actually assigned to the widget. The adjusted allocation is guaranteed to be completely contained within the size_allocate() allocation, however. So a Container is guaranteed that its children stay inside the assigned bounds, but not that they have exactly the bounds the container assigned. There is no way to get the original allocation assigned by size_allocate(), since it isn't stored. If a container implementation needs that information it will have to track it itself.

Returns:
The widget's allocated area.
Widget* Gtk::Widget::get_ancestor ( GType  widget_type)

Gets the first ancestor of widget with type widget_type.

For example, gtk_widget_get_ancestor (widget, GTK_TYPE_BOX) gets the first Gtk::Box that's an ancestor of widget. No reference will be added to the returned widget; it should not be unreferenced. See note about checking for a toplevel Gtk::Window in the docs for get_toplevel().

Note that unlike is_ancestor(), get_ancestor() considers widget to be an ancestor of itself.

Parameters:
widget_typeAncestor type.
Returns:
The ancestor widget, or 0 if not found.
const Widget* Gtk::Widget::get_ancestor ( GType  widget_type) const

Gets the first ancestor of widget with type widget_type.

For example, gtk_widget_get_ancestor (widget, GTK_TYPE_BOX) gets the first Gtk::Box that's an ancestor of widget. No reference will be added to the returned widget; it should not be unreferenced. See note about checking for a toplevel Gtk::Window in the docs for get_toplevel().

Note that unlike is_ancestor(), get_ancestor() considers widget to be an ancestor of itself.

Parameters:
widget_typeAncestor type.
Returns:
The ancestor widget, or 0 if not found.
bool Gtk::Widget::get_app_paintable ( ) const

Determines whether the application intends to draw on the widget in an Gtk::Widget::draw handler.

See set_app_paintable()

Since gtkmm 2.18:
Returns:
true if the widget is app paintable.
bool Gtk::Widget::get_can_default ( ) const

Determines whether widget can be a default widget.

See set_can_default().

Since gtkmm 2.18:
Returns:
true if widget can be a default widget, false otherwise.
bool Gtk::Widget::get_can_focus ( ) const

Determines whether widget can own the input focus.

See set_can_focus().

Since gtkmm 2.18:
Returns:
true if widget can own the input focus, false otherwise.
bool Gtk::Widget::get_child_visible ( ) const

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:
true if the widget is mapped with the parent.
Glib::RefPtr<Clipboard> Gtk::Widget::get_clipboard ( const Glib::ustring selection)

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.

Since gtkmm 2.2:
Parameters:
selectionA Gdk::Atom which identifies the clipboard to use. Gdk::SELECTION_CLIPBOARD gives the default clipboard. Another common value is Gdk::SELECTION_PRIMARY, which gives the primary X selection.
Returns:
The appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
Glib::RefPtr<const Clipboard> Gtk::Widget::get_clipboard ( const Glib::ustring selection) const

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.

Since gtkmm 2.2:
Parameters:
selectionA Gdk::Atom which identifies the clipboard to use. Gdk::SELECTION_CLIPBOARD gives the default clipboard. Another common value is Gdk::SELECTION_PRIMARY, which gives the primary X selection.
Returns:
The appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.
Glib::ustring Gtk::Widget::get_composite_name ( ) const

Obtains the composite name of a widget.

Returns:
The composite name of widget, or an emoty string if widget is not a composite child.
static Widget* Gtk::Widget::get_current_modal_grab ( ) [static]

Retrieve the widget which is currently grabbing all events.

static TextDirection Gtk::Widget::get_default_direction ( ) [static]

Obtains the current default reading direction.

See set_default_direction().

Returns:
The current default direction.
bool Gtk::Widget::get_device_enabled ( const Glib::RefPtr< const Gdk::Device >&  device) const

Returns whether device can interact with widget and its children.

See set_device_enabled().

Since gtkmm 3.0:
Parameters:
deviceA Gdk::Device.
Returns:
true is device is enabled for widget.
Gdk::EventMask Gtk::Widget::get_device_events ( const Glib::RefPtr< const Gdk::Device >&  device) const

Returns the events mask for the widget corresponding to an specific device.

These are the events that the widget will receive when device operates on it.

Since gtkmm 3.0:
Parameters:
deviceA Gdk::Device.
Returns:
Device event mask for widget.
TextDirection Gtk::Widget::get_direction ( ) const

Gets the reading direction for a particular widget.

See set_direction().

Returns:
The reading direction for the widget.
Glib::RefPtr<Gdk::Display> Gtk::Widget::get_display ( )

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.

Since gtkmm 2.2:
Returns:
The Gdk::Display for the toplevel for this widget.
Glib::RefPtr<const Gdk::Display> Gtk::Widget::get_display ( ) const

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.

Since gtkmm 2.2:
Returns:
The Gdk::Display for the toplevel for this widget.
bool Gtk::Widget::get_double_buffered ( ) const

Determines whether the widget is double buffered.

See set_double_buffered()

Since gtkmm 2.18:
Returns:
true if the widget is double buffered.
Gdk::EventMask Gtk::Widget::get_events ( ) const

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.

Returns:
Event mask for widget.
Align Gtk::Widget::get_halign ( ) const

Gets the value of the Gtk::Widget:halign property.

Returns:
The horizontal alignment of widget.
bool Gtk::Widget::get_has_tooltip ( ) const

Returns the current value of the has-tooltip property.

See Gtk::Widget:has-tooltip for more information.

Since gtkmm 2.12:
Returns:
Current value of has-tooltip on widget.
bool Gtk::Widget::get_has_window ( ) const

Determines whether widget has a Gdk::Window of its own.

See set_has_window().

Since gtkmm 2.18:
Returns:
true if widget has a window, false otherwise.
int Gtk::Widget::get_height ( ) const
bool Gtk::Widget::get_hexpand ( ) const

Gets whether the widget would like any available extra horizontal space.

When a user resizes a Gtk::Window, widgets with expand=true generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.

Containers should use compute_expand() rather than this function, to see whether a widget, or any of its children, has the expand flag set. If any child of a widget wants to expand, the parent may ask to expand also.

This function only looks at the widget's own hexpand flag, rather than computing whether the entire widget tree rooted at this widget wants to expand.

Returns:
Whether hexpand flag is set.
bool Gtk::Widget::get_hexpand_set ( ) const

Gets whether set_hexpand() has been used to explicitly set the expand flag on this widget.

If hexpand is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand.

There are few reasons to use this function, but it's here for completeness and consistency.

Returns:
Whether hexpand has been explicitly set.
bool Gtk::Widget::get_is_drawable ( ) const

Determines whether widget can be drawn to.

A widget can be drawn to if it is mapped and visible.

Since gtkmm 2.18:
Returns:
true if widget is drawable, false otherwise.
bool Gtk::Widget::get_is_toplevel ( ) const

Determines whether widget is a toplevel widget.

Currently only Gtk::Window and Gtk::Invisible (and out-of-process Gtk::Plugs) are toplevel widgets. Toplevel widgets have no parent widget.

Since gtkmm 2.18:
Returns:
true if widget is a toplevel, false otherwise.
bool Gtk::Widget::get_mapped ( ) const

Whether the widget is mapped.

Since gtkmm 2.20:
Returns:
true if the widget is mapped, false otherwise.
int Gtk::Widget::get_margin_bottom ( ) const

Gets the value of the Gtk::Widget:margin-bottom property.

Since gtkmm 3.0:
Returns:
The bottom margin of widget.
int Gtk::Widget::get_margin_left ( ) const

Gets the value of the Gtk::Widget:margin-left property.

Since gtkmm 3.0:
Returns:
The left margin of widget.
int Gtk::Widget::get_margin_right ( ) const

Gets the value of the Gtk::Widget:margin-right property.

Since gtkmm 3.0:
Returns:
The right margin of widget.
int Gtk::Widget::get_margin_top ( ) const

Gets the value of the Gtk::Widget:margin-top property.

Since gtkmm 3.0:
Returns:
The top margin of widget.
Glib::ustring Gtk::Widget::get_name ( ) const

Retrieves the name of a widget.

See set_name() for the significance of widget names.

Returns:
Name of the widget. This string is owned by GTK+ and should not be modified or freed.

Reimplemented from Gtk::Buildable.

bool Gtk::Widget::get_no_show_all ( ) const

Returns the current value of the Gtk::Widget:no-show-all property, which determines whether calls to show_all() will affect this widget.

Since gtkmm 2.4:
Returns:
The current value of the "no-show-all" property.
Glib::RefPtr<Pango::Context> Gtk::Widget::get_pango_context ( )

Gets a Pango::Context with the appropriate font map, 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 Gtk::Widget::style-updated and Gtk::Widget::direction-changed signals for the widget.

Returns:
The Pango::Context for the widget.
const Container* Gtk::Widget::get_parent ( ) const

Returns the parent container of widget.

Returns:
The parent container of widget, or 0.
Container* Gtk::Widget::get_parent ( )

Returns the parent container of widget.

Returns:
The parent container of widget, or 0.
Glib::RefPtr<Gdk::Window> Gtk::Widget::get_parent_window ( )

Gets widget's parent window.

Returns:
The parent window of widget.
Glib::RefPtr<const Gdk::Window> Gtk::Widget::get_parent_window ( ) const

Gets widget's parent window.

Returns:
The parent window of widget.
WidgetPath Gtk::Widget::get_path ( ) const

Returns the Gtk::WidgetPath representing widget, if the widget is not connected to a toplevel widget, a partial path will be created.

Returns:
The Gtk::WidgetPath representing widget.
void Gtk::Widget::get_pointer ( int &  x,
int &  y 
) const

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.

Deprecated:
Use Gdk::Window::get_device_position instead.
Parameters:
xReturn location for the X coordinate, or 0.
yReturn location for the Y coordinate, or 0.
void Gtk::Widget::get_preferred_height ( int &  minimum_height,
int &  natural_height 
) const

Retrieves a widget's initial minimum and natural height.

<note>This call is specific to width-for-height requests.</note>

The returned request will be modified by the GtkWidgetClass::adjust_size_request virtual method and by any Gtk::SizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

Since gtkmm 3.0:
Parameters:
minimum_heightLocation to store the minimum height, or 0.
natural_heightLocation to store the natural height, or 0.
void Gtk::Widget::get_preferred_height_for_width ( int  width,
int &  minimum_height,
int &  natural_height 
) const

Retrieves a widget's minimum and natural height if it would be given the specified width.

The returned request will be modified by the GtkWidgetClass::adjust_size_request virtual method and by any Gtk::SizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

Since gtkmm 3.0:
Parameters:
widthThe width which is available for allocation.
minimum_heightLocation for storing the minimum height, or 0.
natural_heightLocation for storing the natural height, or 0.
virtual void Gtk::Widget::get_preferred_height_for_width_vfunc ( int  width,
int &  minimum_height,
int &  natural_height 
) const [protected, virtual]
virtual void Gtk::Widget::get_preferred_height_vfunc ( int &  minimum_height,
int &  natural_height 
) const [protected, virtual]
void Gtk::Widget::get_preferred_size ( Requisition minimum_size,
Requisition natural_size 
) const

Retrieves the minimum and natural size of a widget, taking into account the widget's preference for height-for-width management.

This is used to retrieve a suitable size by container widgets which do not impose any restrictions on the child placement. It can be used to deduce toplevel window and menu sizes as well as child widgets in free-form containers such as GtkLayout.

<note>Handle with care. Note that the natural height of a height-for-width widget will generally be a smaller size than the minimum height, since the required height for the natural width is generally smaller than the required height for the minimum width.</note>

Since gtkmm 3.0:
Parameters:
minimum_sizeLocation for storing the minimum size, or 0.
natural_sizeLocation for storing the natural size, or 0.
void Gtk::Widget::get_preferred_width ( int &  minimum_width,
int &  natural_width 
) const

Retrieves a widget's initial minimum and natural width.

<note>This call is specific to height-for-width requests.</note>

The returned request will be modified by the GtkWidgetClass::adjust_size_request virtual method and by any Gtk::SizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

Since gtkmm 3.0:
Parameters:
minimum_widthLocation to store the minimum width, or 0.
natural_widthLocation to store the natural width, or 0.
void Gtk::Widget::get_preferred_width_for_height ( int  height,
int &  minimum_width,
int &  natural_width 
) const

Retrieves a widget's minimum and natural width if it would be given the specified height.

The returned request will be modified by the GtkWidgetClass::adjust_size_request virtual method and by any Gtk::SizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

Since gtkmm 3.0:
Parameters:
heightThe height which is available for allocation.
minimum_widthLocation for storing the minimum width, or 0.
natural_widthLocation for storing the natural width, or 0.
virtual void Gtk::Widget::get_preferred_width_for_height_vfunc ( int  height,
int &  minimum_width,
int &  natural_width 
) const [protected, virtual]
virtual void Gtk::Widget::get_preferred_width_vfunc ( int &  minimum_width,
int &  natural_width 
) const [protected, virtual]
bool Gtk::Widget::get_realized ( ) const

Determines whether widget is realized.

Since gtkmm 2.20:
Returns:
true if widget is realized, false otherwise.
bool Gtk::Widget::get_receives_default ( ) const

Determines whether widget is alyways treated as default widget withing its toplevel when it has the focus, even if another widget is the default.

See set_receives_default().

Since gtkmm 2.18:
Returns:
true if widget acts as default widget when focussed, false otherwise.
SizeRequestMode Gtk::Widget::get_request_mode ( ) const

Gets whether the widget prefers a height-for-width layout or a width-for-height layout.

<note>Gtk::Bin widgets generally propagate the preference of their child, container widgets need to request something either in context of their children or in context of their allocation capabilities.</note>

Since gtkmm 3.0:
Returns:
The Gtk::SizeRequestMode preferred by widget.
virtual SizeRequestMode Gtk::Widget::get_request_mode_vfunc ( ) const [protected, virtual]
Requisition Gtk::Widget::get_requisition ( ) const [protected]

Retrieves the widget's requisition.

This method should only be used by widget implementations in order to discover whether the widget's requisition has actually changed after some internal state change (so that they can call queue_resize() instead of queue_draw()).

Normally, size_request() should be used.

Returns:
The widget's requisition.

@newin{2,20}

Glib::RefPtr<Gdk::Window> Gtk::Widget::get_root_window ( )

Get the root window where this widget is located.

This function can only be called after the widget has been added to a widget hierarchy 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.

Since gtkmm 2.2:
Returns:
The Gdk::Window root window for the toplevel for this widget.
Glib::RefPtr<const Gdk::Window> Gtk::Widget::get_root_window ( ) const

Get the root window where this widget is located.

This function can only be called after the widget has been added to a widget hierarchy 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.

Since gtkmm 2.2:
Returns:
The Gdk::Window root window for the toplevel for this widget.
Glib::RefPtr<Gdk::Screen> Gtk::Widget::get_screen ( )

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.

Since gtkmm 2.2:
Returns:
The Gdk::Screen for the toplevel for this widget.

Reimplemented in Gtk::Invisible, and Gtk::Window.

Glib::RefPtr<const Gdk::Screen> Gtk::Widget::get_screen ( ) const

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.

Since gtkmm 2.2:
Returns:
The Gdk::Screen for the toplevel for this widget.

Reimplemented in Gtk::Invisible, and Gtk::Window.

bool Gtk::Widget::get_sensitive ( ) const

Returns the widget's sensitivity (in the sense of returning the value that has been set using set_sensitive()).

The effective sensitivity of a widget is however determined by both its own and its parent widget's sensitivity. See is_sensitive().

Since gtkmm 2.18:
Returns:
true if the widget is sensitive.
Glib::RefPtr<Settings> Gtk::Widget::get_settings ( )

Gets the settings object holding the settings 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.

Returns:
The relevant Gtk::Settings object.

Reimplemented in Gtk::PrintUnixDialog.

void Gtk::Widget::get_size_request ( int &  width,
int &  height 
) const

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 request, call get_preferred_size() instead of this function.

Parameters:
widthReturn location for width, or 0.
heightReturn location for height, or 0.
StateType Gtk::Widget::get_state ( ) const

Returns the widget's state.

See set_state().

Since gtkmm 2.18:

Deprecated: 3.0. Use get_state_flags() instead.

Returns:
The state of widget.
StateFlags Gtk::Widget::get_state_flags ( ) const

Returns the widget state as a flag set.

It is worth mentioning that the effective Gtk::STATE_FLAG_INSENSITIVE state will be returned, that is, also based on parent insensitivity, even if widget itself is sensitive.

Since gtkmm 3.0:
Returns:
The state flags for widget.
Glib::RefPtr<StyleContext> Gtk::Widget::get_style_context ( )

Returns the style context associated to widget.

Returns:
A Gtk::StyleContext. This memory is owned by widget and must not be freed.
Glib::RefPtr<Gtk::StyleContext> Gtk::Widget::get_style_context ( ) const

Returns the style context associated to widget.

Returns:
A Gtk::StyleContext. This memory is owned by widget and must not be freed.
template <class PropertyType >
void Gtk::Widget::get_style_property ( const Glib::ustring the_property_name,
PropertyType &  value 
) const
void Gtk::Widget::get_style_property_value ( const Glib::ustring the_property_name,
Glib::ValueBase value 
) const [protected]

Gets the value of a style property of widget.

Parameters:
the_property_nameThe name of a style property.
valueLocation to return the property value.
bool Gtk::Widget::get_support_multidevice ( ) const

Returns true if widget is multiple pointer aware.

See set_support_multidevice() for more information.

Returns:
true if widget is multidevice aware.
Glib::ustring Gtk::Widget::get_tooltip_markup ( ) const

Gets the contents of the tooltip for widget.

Returns:
The tooltip text.
Since gtkmm 2.12:
Glib::ustring Gtk::Widget::get_tooltip_text ( ) const

Gets the contents of the tooltip for widget.

Returns:
The tooltip text.
Since gtkmm 2.12:
Window* Gtk::Widget::get_tooltip_window ( )

Returns the Gtk::Window of the current tooltip.

This can be the GtkWindow created by default, or the custom tooltip window set using set_tooltip_window().

Since gtkmm 2.12:
Returns:
The Gtk::Window of the current tooltip.
const Container* Gtk::Widget::get_toplevel ( ) const

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(); gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW) would return 0 if widget wasn't inside a toplevel window, and if the window was inside a Gtk::Window-derived widget which was in turn inside the toplevel Gtk::Window. While the second case may seem unlikely, it actually happens when a Gtk::Plug is embedded inside a Gtk::Socket within the same application.

To reliably find the toplevel Gtk::Window, use get_toplevel() and check if the T::OPLEVEL flags is set on the result.

Returns:
The topmost ancestor of widget, or widget itself if there's no ancestor.
Container* Gtk::Widget::get_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(); gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW) would return 0 if widget wasn't inside a toplevel window, and if the window was inside a Gtk::Window-derived widget which was in turn inside the toplevel Gtk::Window. While the second case may seem unlikely, it actually happens when a Gtk::Plug is embedded inside a Gtk::Socket within the same application.

To reliably find the toplevel Gtk::Window, use get_toplevel() and check if the T::OPLEVEL flags is set on the result.

Returns:
The topmost ancestor of widget, or widget itself if there's no ancestor.
Align Gtk::Widget::get_valign ( ) const

Gets the value of the Gtk::Widget:valign property.

Returns:
The vertical alignment of widget.
bool Gtk::Widget::get_vexpand ( ) const

Gets whether the widget would like any available extra vertical space.

See get_hexpand() for more detail.

Returns:
Whether vexpand flag is set.
bool Gtk::Widget::get_vexpand_set ( ) const

Gets whether set_vexpand() has been used to explicitly set the expand flag on this widget.

See get_hexpand_set() for more detail.

Returns:
Whether vexpand has been explicitly set.
bool Gtk::Widget::get_visible ( ) const

Determines whether the widget is visible.

Note that this doesn't take into account whether the widget's parent is also visible or the widget is obscured in any way.

See set_visible().

Since gtkmm 2.18:
Returns:
true if the widget is visible.
Glib::RefPtr<Gdk::Visual> Gtk::Widget::get_visual ( )

Gets the visual that will be used to render widget.

Returns:
The visual for widget.
int Gtk::Widget::get_width ( ) const
Glib::RefPtr<Gdk::Window> Gtk::Widget::get_window ( )

Returns the widget's window if it is realized, 0 otherwise.

Since gtkmm 2.14:
Returns:
widget's window.
Glib::RefPtr<const Gdk::Window> Gtk::Widget::get_window ( ) const

Returns the widget's window if it is realized, 0 otherwise.

Since gtkmm 2.14:
Returns:
widget's window.
GtkWidget* Gtk::Widget::gobj ( ) [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Buildable.

Reimplemented in Gtk::AboutDialog, Gtk::AccelLabel, Gtk::Alignment, Gtk::AppChooserButton, Gtk::AppChooserDialog, Gtk::AppChooserWidget, Gtk::Arrow, Gtk::AspectFrame, Gtk::Assistant, Gtk::Bin, Gtk::Box, Gtk::Button, Gtk::ButtonBox, Gtk::Calendar, Gtk::CellView, Gtk::CheckButton, Gtk::CheckMenuItem, Gtk::ColorButton, Gtk::ColorSelection, Gtk::ColorSelectionDialog, Gtk::ComboBox, Gtk::ComboBoxText, Gtk::Container, Gtk::Dialog, Gtk::DrawingArea, Gtk::Entry, Gtk::EventBox, Gtk::Expander, Gtk::FileChooserButton, Gtk::FileChooserDialog, Gtk::FileChooserWidget, Gtk::Fixed, Gtk::FontButton, Gtk::FontChooserDialog, Gtk::FontChooserWidget, Gtk::Frame, Gtk::Grid, Gtk::HandleBox, Gtk::IconView, Gtk::Image, Gtk::ImageMenuItem, Gtk::InfoBar, Gtk::Invisible, Gtk::Label, Gtk::Layout, Gtk::LinkButton, Gtk::Menu, Gtk::MenuBar, Gtk::MenuItem, Gtk::MenuShell, Gtk::MenuToolButton, Gtk::MessageDialog, Gtk::Misc, Gtk::Notebook, Gtk::OffscreenWindow, Gtk::Paned, Gtk::ProgressBar, Gtk::RadioButton, Gtk::RadioMenuItem, Gtk::RadioToolButton, Gtk::Range, Gtk::RecentChooserDialog, Gtk::RecentChooserMenu, Gtk::RecentChooserWidget, Gtk::Scale, Gtk::ScaleButton, Gtk::Scrollbar, Gtk::ScrolledWindow, Gtk::Separator, Gtk::SeparatorMenuItem, Gtk::SeparatorToolItem, Gtk::SpinButton, Gtk::Spinner, Gtk::Statusbar, Gtk::Switch, Gtk::Table, Gtk::TearoffMenuItem, Gtk::TextView, Gtk::ToggleButton, Gtk::ToggleToolButton, Gtk::Toolbar, Gtk::ToolButton, Gtk::ToolItem, Gtk::ToolItemGroup, Gtk::ToolPalette, Gtk::TreeView, Gtk::Viewport, Gtk::VolumeButton, Gtk::Window, Gtk::PageSetupUnixDialog, Gtk::PrintUnixDialog, Gtk::Plug, Gtk::Socket, Gtk::FontSelection, Gtk::FontSelectionDialog, Gtk::VBox, Gtk::HBox, Gtk::VButtonBox, Gtk::HButtonBox, Gtk::HPaned, Gtk::VPaned, Gtk::VScale, Gtk::HScale, Gtk::VScrollbar, Gtk::HScrollbar, Gtk::VSeparator, and Gtk::HSeparator.

const GtkWidget* Gtk::Widget::gobj ( ) const [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Buildable.

Reimplemented in Gtk::AboutDialog, Gtk::AccelLabel, Gtk::Alignment, Gtk::AppChooserButton, Gtk::AppChooserDialog, Gtk::AppChooserWidget, Gtk::Arrow, Gtk::AspectFrame, Gtk::Assistant, Gtk::Bin, Gtk::Box, Gtk::Button, Gtk::ButtonBox, Gtk::Calendar, Gtk::CellView, Gtk::CheckButton, Gtk::CheckMenuItem, Gtk::ColorButton, Gtk::ColorSelection, Gtk::ColorSelectionDialog, Gtk::ComboBox, Gtk::ComboBoxText, Gtk::Container, Gtk::Dialog, Gtk::DrawingArea, Gtk::Entry, Gtk::EventBox, Gtk::Expander, Gtk::FileChooserButton, Gtk::FileChooserDialog, Gtk::FileChooserWidget, Gtk::Fixed, Gtk::FontButton, Gtk::FontChooserDialog, Gtk::FontChooserWidget, Gtk::Frame, Gtk::Grid, Gtk::HandleBox, Gtk::IconView, Gtk::Image, Gtk::ImageMenuItem, Gtk::InfoBar, Gtk::Invisible, Gtk::Label, Gtk::Layout, Gtk::LinkButton, Gtk::Menu, Gtk::MenuBar, Gtk::MenuItem, Gtk::MenuShell, Gtk::MenuToolButton, Gtk::MessageDialog, Gtk::Misc, Gtk::Notebook, Gtk::OffscreenWindow, Gtk::Paned, Gtk::ProgressBar, Gtk::RadioButton, Gtk::RadioMenuItem, Gtk::RadioToolButton, Gtk::Range, Gtk::RecentChooserDialog, Gtk::RecentChooserMenu, Gtk::RecentChooserWidget, Gtk::Scale, Gtk::ScaleButton, Gtk::Scrollbar, Gtk::ScrolledWindow, Gtk::Separator, Gtk::SeparatorMenuItem, Gtk::SeparatorToolItem, Gtk::SpinButton, Gtk::Spinner, Gtk::Statusbar, Gtk::Switch, Gtk::Table, Gtk::TearoffMenuItem, Gtk::TextView, Gtk::ToggleButton, Gtk::ToggleToolButton, Gtk::Toolbar, Gtk::ToolButton, Gtk::ToolItem, Gtk::ToolItemGroup, Gtk::ToolPalette, Gtk::TreeView, Gtk::Viewport, Gtk::VolumeButton, Gtk::Window, Gtk::PageSetupUnixDialog, Gtk::PrintUnixDialog, Gtk::Plug, Gtk::Socket, Gtk::FontSelection, Gtk::FontSelectionDialog, Gtk::VBox, Gtk::HBox, Gtk::VButtonBox, Gtk::HButtonBox, Gtk::HPaned, Gtk::VPaned, Gtk::VScale, Gtk::HScale, Gtk::VScrollbar, Gtk::HScrollbar, Gtk::VSeparator, and Gtk::HSeparator.

void Gtk::Widget::grab_default ( )

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 gtk_widget_set_can_default ( widget, true). The default widget is activated when the user presses Enter in a window. Default widgets must be activatable, that is, activate() should affect them. Note that Gtk::Entry widgets require the "activates-default" property set to true before they activate the default widget when Enter is pressed and the Gtk::Entry is focused.

void Gtk::Widget::grab_focus ( )

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. Use set_can_focus() to modify that flag.

The widget also needs to be realized and mapped. This is indicated by the related signals. Grabbing the focus immediately after creating the widget will likely fail and cause critical warnings.

bool Gtk::Widget::has_default ( ) const

Determines whether widget is the current default widget within its toplevel.

See set_can_default().

Since gtkmm 2.18:
Returns:
true if widget is the current default widget within its toplevel, false otherwise.
bool Gtk::Widget::has_focus ( ) const

Determines if the widget has the global input focus.

See is_focus() for the difference between having the global input focus, and only having the focus within a toplevel.

Since gtkmm 2.18:
Returns:
true if the widget has the global input focus.
bool Gtk::Widget::has_grab ( ) const

Determines whether the widget is currently grabbing events, so it is the only widget receiving input events (keyboard and mouse).

See also gtk_grab_add().

Since gtkmm 2.18:
Returns:
true if the widget is in the grab_widgets stack.
bool Gtk::Widget::has_screen ( ) const

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 hierarchy with a toplevel window at the top.

Since gtkmm 2.2:
Returns:
true if there is a Gdk::Screen associcated with the widget.
void Gtk::Widget::hide ( )

Reverses the effects of show(), causing the widget to be hidden (invisible to the user).

bool Gtk::Widget::in_destruction ( ) const

Returns whether the widget is currently being destroyed.

This information can sometimes be used to avoid doing unnecessary work.

Returns:
true if widget is being destroyed.
void Gtk::Widget::input_shape_combine_region ( const ::Cairo::RefPtr< const ::Cairo::Region > &  region)

Sets an input shape for this widget's GDK window.

This allows for windows which react to mouse click in a nonrectangular region, see gdk_window_input_shape_combine_region() for more information.

Since gtkmm 3.0:
Parameters:
regionShape to be added, or 0 to remove an existing shape.
bool Gtk::Widget::intersect ( const Gdk::Rectangle area) const
bool Gtk::Widget::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.

intersection may be 0 if you're only interested in whether there was an intersection.

Parameters:
areaA rectangle.
intersectionRectangle to store intersection of widget and area.
Returns:
true if there was an intersection.
bool Gtk::Widget::is_ancestor ( Widget ancestor) const

Determines whether widget is somewhere inside ancestor, possibly with intermediate containers.

Parameters:
ancestorAnother Gtk::Widget.
Returns:
true if ancestor contains widget as a child, grandchild, great grandchild, etc.
bool Gtk::Widget::is_composited ( ) const

Whether widget can rely on having its alpha channel drawn correctly.

On X11 this function returns whether a compositing manager is running for widget's screen.

Please note that the semantics of this call will change in the future if used on a widget that has a composited window in its hierarchy (as set by gdk_window_set_composited()).

Since gtkmm 2.10:
Returns:
true if the widget can rely on its alpha channel being drawn correctly.
bool Gtk::Widget::is_focus ( ) const

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.)

Returns:
true if the widget is the focus widget.
bool Gtk::Widget::is_sensitive ( ) const

Returns the widget's effective sensitivity, which means it is sensitive itself and also its parent widget is sensitive.

Since gtkmm 2.18:
Returns:
true if the widget is effectively sensitive.
bool Gtk::Widget::keynav_failed ( DirectionType  direction)

This function should be called whenever keyboard navigation within a single widget hits a boundary.

The function emits the Gtk::Widget::keynav-failed signal on the widget and its return value should be interpreted in a way similar to the return value of child_focus():

When true is returned, stay in the widget, the failed keyboard navigation is Ok and/or there is nowhere we can/should move the focus to.

When false is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling child_focus() on the widget's toplevel.

The default ::keynav-failed handler returns true for Gtk::DIR_TAB_FORWARD and Gtk::DIR_TAB_BACKWARD. For the other values of Gtk::DirectionType, it looks at the Gtk::Settings:gtk-keynav-cursor-only setting and returns false if the setting is true. This way the entire user interface becomes cursor-navigatable on input devices such as mobile phones which only have cursor keys but no tab key.

Whenever the default handler returns true, it also calls error_bell() to notify the user of the failed keyboard navigation.

A use case for providing an own implementation of ::keynav-failed (either by connecting to it or by overriding it) would be a row of Gtk::Entry widgets where the user should be able to navigate the entire row with the cursor keys, as e.g. known from user interfaces that require entering license keys.

Since gtkmm 2.12:
Parameters:
directionDirection of focus movement.
Returns:
true if stopping keyboard navigation is fine, false if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).
std::vector<Widget*> Gtk::Widget::list_mnemonic_labels ( )

Returns a newly allocated list of the widgets, normally labels, for which this widget is the target of a mnemonic (see for example, Gtk::Label::set_mnemonic_widget()).

The widgets in the list are not individually referenced. If you want to iterate through the list and perform actions involving callbacks that might destroy the widgets, you must call g_list_foreach (result, (GFunc)g_object_ref, 0) first, and then unref all the widgets afterwards.

Since gtkmm 2.4:
Returns:
The list of mnemonic labels; free this list with Glib::list_free() when you are done with it.
std::vector<const Widget*> Gtk::Widget::list_mnemonic_labels ( ) const

Returns a newly allocated list of the widgets, normally labels, for which this widget is the target of a mnemonic (see for example, Gtk::Label::set_mnemonic_widget()).

The widgets in the list are not individually referenced. If you want to iterate through the list and perform actions involving callbacks that might destroy the widgets, you must call g_list_foreach (result, (GFunc)g_object_ref, 0) first, and then unref all the widgets afterwards.

Since gtkmm 2.4:
Returns:
The list of mnemonic labels; free this list with Glib::list_free() when you are done with it.
void Gtk::Widget::map ( )

This function is only for use in widget implementations.

Causes a widget to be mapped if it isn't already.

bool Gtk::Widget::mnemonic_activate ( bool  group_cycling)

Emits the Gtk::Widget::mnemonic-activate signal.

The default handler for this signal activates the widget if group_cycling is false, and just grabs the focus if group_cycling is true.

Parameters:
group_cyclingtrue if there are other widgets with the same mnemonic.
Returns:
true if the signal has been handled.
virtual bool Gtk::Widget::on_button_press_event ( GdkEventButton *  event) [protected, virtual]
virtual bool Gtk::Widget::on_button_release_event ( GdkEventButton *  event) [protected, virtual]
virtual void Gtk::Widget::on_child_notify ( GParamSpec *  pspec) [protected, virtual]
virtual bool Gtk::Widget::on_configure_event ( GdkEventConfigure *  event) [protected, virtual]
virtual bool Gtk::Widget::on_delete_event ( GdkEventAny *  event) [protected, virtual]
virtual void Gtk::Widget::on_direction_changed ( TextDirection  direction) [protected, virtual]
virtual void Gtk::Widget::on_drag_begin ( const Glib::RefPtr< Gdk::DragContext >&  context) [protected, virtual]
virtual void Gtk::Widget::on_drag_data_delete ( const Glib::RefPtr< Gdk::DragContext >&  context) [protected, virtual]
virtual void Gtk::Widget::on_drag_data_get ( const Glib::RefPtr< Gdk::DragContext >&  context,
SelectionData selection_data,
guint  info,
guint  time 
) [protected, virtual]
virtual void Gtk::Widget::on_drag_data_received ( const Glib::RefPtr< Gdk::DragContext >&  context,
int  x,
int  y,
const SelectionData selection_data,
guint  info,
guint  time 
) [protected, virtual]
virtual bool Gtk::Widget::on_drag_drop ( const Glib::RefPtr< Gdk::DragContext >&  context,
int  x,
int  y,
guint  time 
) [protected, virtual]
virtual void Gtk::Widget::on_drag_end ( const Glib::RefPtr< Gdk::DragContext >&  context) [protected, virtual]
virtual void Gtk::Widget::on_drag_leave ( const Glib::RefPtr< Gdk::DragContext >&  context,
guint  time 
) [protected, virtual]
virtual bool Gtk::Widget::on_drag_motion ( const Glib::RefPtr< Gdk::DragContext >&  context,
int  x,
int  y,
guint  time 
) [protected, virtual]
virtual bool Gtk::Widget::on_draw ( const ::Cairo::RefPtr< ::Cairo::Context > &  cr) [protected, virtual]
virtual bool Gtk::Widget::on_enter_notify_event ( GdkEventCrossing *  event) [protected, virtual]
virtual bool Gtk::Widget::on_event ( GdkEvent *  event) [protected, virtual]
virtual bool Gtk::Widget::on_focus ( DirectionType  direction) [protected, virtual]
virtual bool Gtk::Widget::on_focus_in_event ( GdkEventFocus *  event) [protected, virtual]
virtual bool Gtk::Widget::on_focus_out_event ( GdkEventFocus *  event) [protected, virtual]
virtual void Gtk::Widget::on_grab_focus ( ) [protected, virtual]
virtual void Gtk::Widget::on_grab_notify ( bool  was_grabbed) [protected, virtual]
virtual void Gtk::Widget::on_hide ( ) [protected, virtual]
virtual void Gtk::Widget::on_hierarchy_changed ( Widget previous_toplevel) [protected, virtual]
virtual bool Gtk::Widget::on_key_press_event ( GdkEventKey *  event) [protected, virtual]
virtual bool Gtk::Widget::on_key_release_event ( GdkEventKey *  event) [protected, virtual]
virtual bool Gtk::Widget::on_leave_notify_event ( GdkEventCrossing *  event) [protected, virtual]
virtual void Gtk::Widget::on_map ( ) [protected, virtual]
virtual bool Gtk::Widget::on_map_event ( GdkEventAny *  event) [protected, virtual]
virtual bool Gtk::Widget::on_mnemonic_activate ( bool  group_cycling) [protected, virtual]
virtual bool Gtk::Widget::on_motion_notify_event ( GdkEventMotion *  event) [protected, virtual]
virtual void Gtk::Widget::on_parent_changed ( Widget previous_parent) [protected, virtual]
virtual bool Gtk::Widget::on_property_notify_event ( GdkEventProperty *  event) [protected, virtual]
virtual bool Gtk::Widget::on_proximity_in_event ( GdkEventProximity *  event) [protected, virtual]
virtual bool Gtk::Widget::on_proximity_out_event ( GdkEventProximity *  event) [protected, virtual]
virtual void Gtk::Widget::on_realize ( ) [protected, virtual]
virtual void Gtk::Widget::on_screen_changed ( const Glib::RefPtr< Gdk::Screen >&  previous_screen) [protected, virtual]
virtual bool Gtk::Widget::on_scroll_event ( GdkEventScroll *  event) [protected, virtual]
virtual bool Gtk::Widget::on_selection_clear_event ( GdkEventSelection *  event) [protected, virtual]
virtual void Gtk::Widget::on_selection_get ( SelectionData selection_data,
guint  info,
guint  time 
) [protected, virtual]
virtual bool Gtk::Widget::on_selection_notify_event ( GdkEventSelection *  event) [protected, virtual]
virtual void Gtk::Widget::on_selection_received ( const SelectionData selection_data,
guint  time 
) [protected, virtual]
virtual bool Gtk::Widget::on_selection_request_event ( GdkEventSelection *  event) [protected, virtual]
virtual void Gtk::Widget::on_show ( ) [protected, virtual]
virtual void Gtk::Widget::on_size_allocate ( Allocation allocation) [protected, virtual]<