Ardour  9.0-pre0-582-g084a23a80d
Gtk::Widget Class Reference

#include <widget.h>

Inheritance diagram for Gtk::Widget:
[legend]

Public Member Functions

virtual ~Widget ()
 
GtkWidgetgobj ()
 Provides access to the underlying C GtkObject. More...
 
const GtkWidgetgobj () const
 Provides access to the underlying C GtkObject. More...
 
bool set_scroll_adjustments (Adjustment &hadjustment, Adjustment &vadjustment)
 
void show ()
 
void show_now ()
 
void hide ()
 
void show_all ()
 
void hide_all ()
 
void queue_draw ()
 
void queue_draw_area (int x, int y, int width, int height)
 
void queue_resize ()
 
Requisition size_request () const
 
void size_request (const Requisition &requisition)
 
void size_allocate (const Allocation &allocation)
 
void add_accelerator (const Glib::ustring &accel_signal, const Glib::RefPtr< AccelGroup > &accel_group, guint accel_key, Gdk::ModifierType accel_mods, AccelFlags accel_flags)
 
bool remove_accelerator (const Glib::RefPtr< AccelGroup > &accel_group, guint accel_key, Gdk::ModifierType accel_mods)
 
void set_accel_path (const Glib::ustring &accel_path, const Glib::RefPtr< AccelGroup > &accel_group)
 
bool mnemonic_activate (bool group_cycling)
 
bool event (GdkEvent *event)
 
int send_expose (GdkEvent *event)
 
bool send_focus_change (GdkEvent *event)
 
bool activate ()
 
void reparent (Widget &new_parent)
 
bool intersect (const Gdk::Rectangle &area) const
 
bool intersect (const Gdk::Rectangle &area, Gdk::Rectangle &intersection) const
 
Gdk::Region region_intersect (const Gdk::Region &region) const
 
void freeze_child_notify ()
 
void child_notify (const Glib::ustring &child_property)
 
void thaw_child_notify ()
 
void set_can_focus (bool can_focus=true)
 
bool get_can_focus () const
 
bool can_focus () const
 
bool has_focus () const
 
bool is_focus () const
 
void grab_focus ()
 
void set_can_default (bool can_default=true)
 
bool get_can_default () const
 
bool can_default () const
 
bool has_default () const
 
void grab_default ()
 
void set_receives_default (bool receives_default=true)
 
bool get_receives_default () const
 
bool has_grab () const
 
void add_modal_grab ()
 
void remove_modal_grab ()
 
void set_name (const Glib::ustring &name)
 
void unset_name ()
 
Glib::ustring get_name () const
 
void set_state (StateType state)
 
StateType get_state () const
 
void set_sensitive (bool sensitive=true)
 
bool get_sensitive () const
 
bool is_sensitive () const
 
void set_visible (bool visible=true)
 
bool get_visible () const
 
void set_has_window (bool has_window=true)
 
bool get_has_window () const
 
bool get_is_toplevel () const
 
bool get_is_drawable () const
 
bool get_realized () const
 
bool get_mapped () const
 
void set_app_paintable (bool app_paintable=true)
 
bool get_app_paintable () const
 
void set_double_buffered (bool double_buffered=true)
 
bool get_double_buffered () const
 
void set_redraw_on_allocate (bool redraw_on_allocate=true)
 
void set_child_visible (bool is_visible=true)
 
bool get_child_visible () const
 
void set_window (const Glib::RefPtr< Gdk::Window > &window)
 
Glib::RefPtr< Gdk::Windowget_window ()
 
Glib::RefPtr< const Gdk::Windowget_window () const
 
Allocation get_allocation () const
 
void set_allocation (const Allocation &allocation)
 
Containerget_parent ()
 
const Containerget_parent () const
 
Glib::RefPtr< Gdk::Windowget_parent_window ()
 
Glib::RefPtr< const Gdk::Windowget_parent_window () const
 
void set_parent_window (const Glib::RefPtr< const Gdk::Window > &parent_window)
 
bool child_focus (DirectionType direction)
 
bool keynav_failed (DirectionType direction)
 
void error_bell ()
 
void set_size_request (int width=-1, int height=-1)
 
void get_size_request (int &width, int &height) const
 
void set_events (Gdk::EventMask events)
 
void add_events (Gdk::EventMask events)
 
void set_extension_events (Gdk::ExtensionMode mode)
 
Gdk::ExtensionMode get_extension_events () const
 
Containerget_toplevel ()
 
const Containerget_toplevel () const
 
Widgetget_ancestor (GType widget_type)
 
const Widgetget_ancestor (GType widget_type) const
 
Glib::RefPtr< Gdk::Colormapget_colormap ()
 
Glib::RefPtr< Gdk::Visualget_visual ()
 
Glib::RefPtr< Gdk::Screenget_screen ()
 
Glib::RefPtr< const Gdk::Screenget_screen () const
 
bool has_screen () const
 
Glib::RefPtr< Gdk::Displayget_display ()
 
Glib::RefPtr< const Gdk::Displayget_display () const
 
Glib::RefPtr< Gdk::Windowget_root_window ()
 
Glib::RefPtr< const Gdk::Windowget_root_window () const
 
Glib::RefPtr< Settingsget_settings ()
 
Glib::RefPtr< Clipboardget_clipboard (const Glib::ustring &selection)
 
Glib::RefPtr< const Clipboardget_clipboard (const Glib::ustring &selection) const
 
Glib::RefPtr< Gdk::Pixmapget_snapshot (Gdk::Rectangle &clip_rect) const
 
Glib::RefPtr< Gdk::Pixmapget_snapshot () const
 
void set_colormap (const Glib::RefPtr< const Gdk::Colormap > &colormap)
 
Gdk::EventMask get_events () const
 
void get_pointer (int &x, int &y) const
 
bool is_ancestor (Widget &ancestor) const
 
bool translate_coordinates (Widget &dest_widget, int src_x, int src_y, int &dest_x, int &dest_y)
 
bool has_rc_style () const
 
void set_style (const Glib::RefPtr< Style > &style)
 
void unset_style ()
 
void ensure_style ()
 
Glib::RefPtr< Styleget_style ()
 
Glib::RefPtr< const Styleget_style () const
 
void modify_style (const Glib::RefPtr< RcStyle > &style)
 
Glib::RefPtr< RcStyleget_modifier_style ()
 
Glib::RefPtr< const RcStyleget_modifier_style () const
 
void modify_fg (StateType state, const Gdk::Color &color)
 
void modify_bg (StateType state, const Gdk::Color &color)
 
void modify_bg_pixmap (StateType state, const Glib::ustring &pixmap_name)
 
void modify_text (StateType state, const Gdk::Color &color)
 
void modify_base (StateType state, const Gdk::Color &color)
 
void modify_cursor (const Gdk::Color &primary, const Gdk::Color &secondary)
 
void unset_cursor ()
 See modify_cursor(). More...
 
void modify_font (const Pango::FontDescription &font_desc)
 
void unset_fg (StateType state)
 
void unset_bg (StateType state)
 
void unset_text (StateType state)
 
void unset_base (StateType state)
 
void unset_font ()
 
template<class PropertyType >
void get_style_property (const Glib::ustring &the_property_name, PropertyType &value) const
 
Glib::RefPtr< Pango::Context > create_pango_context ()
 
Glib::RefPtr< Pango::Context > get_pango_context ()
 
Glib::RefPtr< Pango::Layout > create_pango_layout (const Glib::ustring &text)
 
Glib::RefPtr< Gdk::Pixbufrender_icon (const StockID &stock_id, IconSize size, const Glib::ustring &detail=Glib::ustring())
 
void set_composite_name (const Glib::ustring &name)
 
void unset_composite_name ()
 
Glib::ustring get_composite_name () const
 
void reset_rc_styles ()
 
void set_direction (TextDirection dir)
 
TextDirection get_direction ()
 
TextDirection get_direction () const
 
void shape_combine_mask (const Glib::RefPtr< const Gdk::Bitmap > &shape_mask, int offset_x, int offset_y)
 
void unset_shape_combine_mask ()
 
void input_shape_combine_mask (const Glib::RefPtr< const Gdk::Bitmap > &shape_mask, int offset_x, int offset_y)
 
void unset_input_shape_combine_mask ()
 
void reset_shapes ()
 
void path (Glib::ustring &path, Glib::ustring &path_reversed)
 Compute a widget's path of the form "GtkWindow.MyLabel". More...
 
void class_path (Glib::ustring &path, Glib::ustring &path_reversed)
 
Glib::ListHandle< Widget * > list_mnemonic_labels ()
 
Glib::ListHandle< const Widget * > list_mnemonic_labels () const
 
void add_mnemonic_label (Widget &label)
 
void remove_mnemonic_label (Widget &label)
 
void drag_get_data (const Glib::RefPtr< Gdk::DragContext > &context, Glib::ustring &target, guint32 time)
 
void drag_get_data (const Glib::RefPtr< Gdk::DragContext > &context, const Glib::ustring &target, guint32 time)
 
void drag_highlight ()
 
void drag_unhighlight ()
 
void drag_dest_set (DestDefaults flags=DestDefaults(0), Gdk::DragAction actions=Gdk::DragAction(0))
 
void drag_dest_set (const ArrayHandle_TargetEntry &targets, DestDefaults flags=DEST_DEFAULT_ALL, Gdk::DragAction actions=Gdk::ACTION_COPY)
 
void drag_dest_set_proxy (const Glib::RefPtr< Gdk::Window > &proxy_window, Gdk::DragProtocol protocol, bool use_coordinates)
 
void drag_dest_unset ()
 
Glib::ustring drag_dest_find_target (const Glib::RefPtr< Gdk::DragContext > &context, const Glib::RefPtr< TargetList > &target_list) const
 
Glib::ustring drag_dest_find_target (const Glib::RefPtr< Gdk::DragContext > &context) const
 
Glib::RefPtr< TargetListdrag_dest_get_target_list ()
 
Glib::RefPtr< const TargetListdrag_dest_get_target_list () const
 
void drag_dest_set_target_list (const Glib::RefPtr< TargetList > &target_list)
 
void drag_dest_add_text_targets ()
 
void drag_dest_add_image_targets ()
 
void drag_dest_add_uri_targets ()
 
void drag_source_set (const ArrayHandle_TargetEntry &targets, Gdk::ModifierType start_button_mask=Gdk::MODIFIER_MASK, Gdk::DragAction actions=Gdk::ACTION_COPY)
 
void drag_source_unset ()
 
void drag_source_set_icon (const Glib::RefPtr< Gdk::Colormap > &colormap, const Glib::RefPtr< Gdk::Pixmap > &pixmap, const Glib::RefPtr< Gdk::Bitmap > &mask)
 
void drag_source_set_icon (const Glib::RefPtr< Gdk::Pixbuf > &pixbuf)
 
void drag_source_set_icon (const StockID &stock_id)
 
void drag_source_set_icon (const Glib::ustring &icon_name)
 
void drag_source_add_text_targets ()
 
void drag_source_add_uri_targets ()
 
void drag_source_add_image_targets ()
 
Glib::RefPtr< Gdk::DragContextdrag_begin (const Glib::RefPtr< TargetList > &targets, Gdk::DragAction actions, int button, GdkEvent *event)
 
bool drag_check_threshold (int start_x, int start_y, int current_x, int current_y)
 
void drag_set_as_icon (const Glib::RefPtr< Gdk::DragContext > &context, int hot_x, int hot_y)
 
void queue_resize_no_redraw ()
 
bool get_no_show_all () const
 
void set_no_show_all (bool no_show_all=true)
 
void set_parent (Widget &parent)
 
void unparent ()
 
void map ()
 
void unmap ()
 
void draw_insertion_cursor (Glib::RefPtr< Gdk::Drawable > drawable, const Gdk::Rectangle &area, const Gdk::Rectangle &location, bool is_primary, TextDirection direction, bool draw_arrow=true)
 
void set_tooltip_window (Window &window)
 
Windowget_tooltip_window ()
 
void trigger_tooltip_query ()
 
void set_tooltip_text (const Glib::ustring &text)
 
Glib::ustring get_tooltip_text () const
 
void set_tooltip_markup (const Glib::ustring &markup)
 
Glib::ustring get_tooltip_markup () const
 
void set_has_tooltip (bool has_tooltip=TRUE)
 
bool get_has_tooltip () const
 
bool has_no_window () const
 
bool is_realized () const
 
bool is_mapped () const
 
bool is_toplevel () const
 
bool is_drawable () const
 
bool is_visible () const
 
bool sensitive () const
 
bool app_paintable () const
 
bool receives_default () const
 
bool double_buffered () const
 
bool parent_sensitive () const
 
bool rc_style () const
 
bool is_composite_child () const
 
WidgetFlags get_flags () const
 
void set_flags (WidgetFlags flags)
 
void unset_flags (WidgetFlags flags)
 
Gtk::StateType get_saved_state () const
 
int get_width () const
 
int get_height () const
 
bool is_composited () const
 
Glib::RefPtr< Actionget_action ()
 
Glib::RefPtr< const Actionget_action () const
 
Requisition get_requisition () const
 
Glib::SignalProxy0< void > signal_show ()
 
Glib::SignalProxy0< void > signal_hide ()
 
Glib::SignalProxy0< void > signal_map ()
 Emitted on mapping of a widget to the screen. More...
 
Glib::SignalProxy0< void > signal_unmap ()
 
Glib::SignalProxy0< void > signal_realize ()
 Emitted on realization of a widget. More...
 
Glib::SignalProxy0< void > signal_unrealize ()
 
Glib::SignalProxy1< void, Requisition * > signal_size_request ()
 
Glib::SignalProxy1< void, Allocation & > signal_size_allocate ()
 
Glib::SignalProxy1< void, Gtk::StateTypesignal_state_changed ()
 
Glib::SignalProxy1< void, Widget * > signal_parent_changed ()
 Informs objects that their parent changed. More...
 
Glib::SignalProxy1< void, Widget * > signal_hierarchy_changed ()
 
Glib::SignalProxy1< void, const Glib::RefPtr< Gtk::Style > & > signal_style_changed ()
 
Glib::SignalProxy1< void, TextDirectionsignal_direction_changed ()
 
Glib::SignalProxy1< void, bool > signal_grab_notify ()
 
Glib::SignalProxy1< void, GParamSpec * > signal_child_notify ()
 
Glib::SignalProxy1< bool, bool > signal_mnemonic_activate ()
 
Glib::SignalProxy0< void > signal_grab_focus ()
 
Glib::SignalProxy1< bool, DirectionTypesignal_focus ()
 
Glib::SignalProxy1< bool, GdkEvent * > signal_event ()
 
Glib::SignalProxy1< void, GdkEvent * > signal_event_after ()
 
Glib::SignalProxy1< bool, GdkEventButton * > signal_button_press_event ()
 
Glib::SignalProxy1< bool, GdkEventButton * > signal_button_release_event ()
 
Glib::SignalProxy1< bool, GdkEventScroll * > signal_scroll_event ()
 
Glib::SignalProxy1< bool, GdkEventMotion * > signal_motion_notify_event ()
 
Glib::SignalProxy1< bool, GdkEventAny * > signal_delete_event ()
 
Glib::SignalProxy1< bool, GdkEventExpose * > signal_expose_event ()
 Event triggered by window requiring a refresh. More...
 
Glib::SignalProxy1< bool, GdkEventKey * > signal_key_press_event ()
 
Glib::SignalProxy1< bool, GdkEventKey * > signal_key_release_event ()
 
Glib::SignalProxy1< bool, GdkEventCrossing * > signal_enter_notify_event ()
 
Glib::SignalProxy1< bool, GdkEventCrossing * > signal_leave_notify_event ()
 
Glib::SignalProxy1< bool, GdkEventConfigure * > signal_configure_event ()
 
Glib::SignalProxy1< bool, GdkEventFocus * > signal_focus_in_event ()
 
Glib::SignalProxy1< bool, GdkEventFocus * > signal_focus_out_event ()
 
Glib::SignalProxy1< bool, GdkEventAny * > signal_map_event ()
 
Glib::SignalProxy1< bool, GdkEventAny * > signal_unmap_event ()
 
Glib::SignalProxy1< bool, GdkEventProperty * > signal_property_notify_event ()
 
Glib::SignalProxy1< bool, GdkEventSelection * > signal_selection_clear_event ()
 
Glib::SignalProxy1< bool, GdkEventSelection * > signal_selection_request_event ()
 
Glib::SignalProxy1< bool, GdkEventSelection * > signal_selection_notify_event ()
 
Glib::SignalProxy1< bool, GdkEventProximity * > signal_proximity_in_event ()
 
Glib::SignalProxy1< bool, GdkEventProximity * > signal_proximity_out_event ()
 
Glib::SignalProxy1< bool, GdkEventVisibility * > signal_visibility_notify_event ()
 
Glib::SignalProxy1< bool, GdkEventClient * > signal_client_event ()
 
Glib::SignalProxy1< bool, GdkEventAny * > signal_no_expose_event ()
 
Glib::SignalProxy1< bool, GdkEventWindowState * > signal_window_state_event ()
 
Glib::SignalProxy3< void, 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 ()
 
Glib::SignalProxy1< void, const Glib::RefPtr< Gdk::DragContext > & > signal_drag_end ()
 
Glib::SignalProxy4< void, const Glib::RefPtr< Gdk::DragContext > &, SelectionData &, guint, guint > signal_drag_data_get ()
 
Glib::SignalProxy1< void, const Glib::RefPtr< Gdk::DragContext > & > signal_drag_data_delete ()
 
Glib::SignalProxy2< bool, const Glib::RefPtr< Gdk::DragContext > &, DragResultsignal_drag_failed ()
 
Glib::SignalProxy2< void, const Glib::RefPtr< Gdk::DragContext > &, guint > signal_drag_leave ()
 
Glib::SignalProxy4< bool, const Glib::RefPtr< Gdk::DragContext > &, int, int, guint > signal_drag_motion ()
 
Glib::SignalProxy4< bool, const Glib::RefPtr< Gdk::DragContext > &, int, int, guint > signal_drag_drop ()
 
Glib::SignalProxy6< void, const Glib::RefPtr< Gdk::DragContext > &, int, int, const SelectionData &, guint, guint > signal_drag_data_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 ()
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_name () const
 
Glib::PropertyProxy< Container * > property_parent ()
 
Glib::PropertyProxy_ReadOnly< Container * > property_parent () const
 
Glib::PropertyProxy< int > property_width_request ()
 
Glib::PropertyProxy_ReadOnly< int > property_width_request () const
 
Glib::PropertyProxy< int > property_height_request ()
 
Glib::PropertyProxy_ReadOnly< int > property_height_request () const
 
Glib::PropertyProxy< bool > property_visible ()
 
Glib::PropertyProxy_ReadOnly< bool > property_visible () const
 
Glib::PropertyProxy< bool > property_sensitive ()
 
Glib::PropertyProxy_ReadOnly< bool > property_sensitive () const
 
Glib::PropertyProxy< bool > property_app_paintable ()
 
Glib::PropertyProxy_ReadOnly< bool > property_app_paintable () const
 
Glib::PropertyProxy< bool > property_can_focus ()
 
Glib::PropertyProxy_ReadOnly< bool > property_can_focus () const
 
Glib::PropertyProxy< bool > property_has_focus ()
 
Glib::PropertyProxy_ReadOnly< bool > property_has_focus () const
 
Glib::PropertyProxy< bool > property_is_focus ()
 
Glib::PropertyProxy_ReadOnly< bool > property_is_focus () const
 
Glib::PropertyProxy< bool > property_can_default ()
 
Glib::PropertyProxy_ReadOnly< bool > property_can_default () const
 
Glib::PropertyProxy< bool > property_has_default ()
 
Glib::PropertyProxy_ReadOnly< bool > property_has_default () const
 
Glib::PropertyProxy< bool > property_receives_default ()
 
Glib::PropertyProxy_ReadOnly< bool > property_receives_default () const
 
Glib::PropertyProxy_ReadOnly< bool > property_composite_child () const
 
Glib::PropertyProxy< Glib::RefPtr< Style > > property_style ()
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Style > > property_style () const
 
Glib::PropertyProxy< Gdk::EventMaskproperty_events ()
 
Glib::PropertyProxy_ReadOnly< Gdk::EventMaskproperty_events () const
 
Glib::PropertyProxy< Gdk::ExtensionModeproperty_extension_events ()
 
Glib::PropertyProxy_ReadOnly< Gdk::ExtensionModeproperty_extension_events () const
 
Glib::PropertyProxy< bool > property_has_tooltip ()
 
Glib::PropertyProxy_ReadOnly< bool > property_has_tooltip () const
 
Glib::PropertyProxy< Glib::ustring > property_tooltip_markup ()
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_tooltip_markup () const
 
Glib::PropertyProxy< Glib::ustring > property_tooltip_text ()
 
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_tooltip_text () const
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gdk::Window > > property_window () const
 
Glib::PropertyProxy< bool > property_no_show_all ()
 
Glib::PropertyProxy_ReadOnly< bool > property_no_show_all () const
 
Glib::PropertyProxy< bool > property_double_buffered ()
 
Glib::PropertyProxy_ReadOnly< bool > property_double_buffered () const
 
- Public Member Functions inherited from Gtk::Object
virtual ~Object ()
 
GtkObjectgobj ()
 Provides access to the underlying C GtkObject. More...
 
const GtkObjectgobj () const
 Provides access to the underlying C GtkObject. More...
 
Glib::PropertyProxy< void * > property_user_data ()
 
Glib::PropertyProxy_ReadOnly< void * > property_user_data () const
 

Static Public Member Functions

static Widgetget_current_modal_grab ()
 
static void push_colormap (const Glib::RefPtr< const Gdk::Colormap > &cmap)
 
static void pop_colormap ()
 
static void push_composite_child ()
 
static void pop_composite_child ()
 
static void set_default_colormap (const Glib::RefPtr< const Gdk::Colormap > &colormap)
 
static Glib::RefPtr< Styleget_default_style ()
 
static Glib::RefPtr< Gdk::Colormapget_default_colormap ()
 
static Glib::RefPtr< Gdk::Visualget_default_visual ()
 
static void set_default_direction (TextDirection dir)
 
static TextDirection get_default_direction ()
 
static Widgetdrag_get_source_widget (const Glib::RefPtr< Gdk::DragContext > &context)
 

Protected Member Functions

virtual void on_show ()
 This is a default handler for the signal signal_show(). More...
 
virtual void on_hide ()
 This is a default handler for the signal signal_hide(). More...
 
virtual void on_map ()
 This is a default handler for the signal signal_map(). More...
 
virtual void on_unmap ()
 This is a default handler for the signal signal_unmap(). More...
 
virtual void on_realize ()
 This is a default handler for the signal signal_realize(). More...
 
virtual void on_unrealize ()
 This is a default handler for the signal signal_unrealize(). More...
 
virtual void on_size_request (Requisition *requisition)
 This is a default handler for the signal signal_size_request(). More...
 
virtual void on_size_allocate (Allocation &allocation)
 This is a default handler for the signal signal_size_allocate(). More...
 
virtual void on_state_changed (Gtk::StateType previous_state)
 This is a default handler for the signal signal_state_changed(). More...
 
virtual void on_parent_changed (Widget *previous_parent)
 This is a default handler for the signal signal_parent_changed(). More...
 
virtual void on_hierarchy_changed (Widget *previous_toplevel)
 This is a default handler for the signal signal_hierarchy_changed(). More...
 
virtual void on_style_changed (const Glib::RefPtr< Gtk::Style > &previous_style)
 This is a default handler for the signal signal_style_changed(). More...
 
virtual void on_direction_changed (TextDirection direction)
 This is a default handler for the signal signal_direction_changed(). More...
 
virtual void on_grab_notify (bool was_grabbed)
 This is a default handler for the signal signal_grab_notify(). More...
 
virtual void on_child_notify (GParamSpec *pspec)
 This is a default handler for the signal signal_child_notify(). More...
 
virtual bool on_mnemonic_activate (bool group_cycling)
 This is a default handler for the signal signal_mnemonic_activate(). More...
 
virtual void on_grab_focus ()
 This is a default handler for the signal signal_grab_focus(). More...
 
virtual bool on_focus (DirectionType direction)
 This is a default handler for the signal signal_focus(). More...
 
virtual bool on_event (GdkEvent *event)
 This is a default handler for the signal signal_event(). More...
 
virtual bool on_button_press_event (GdkEventButton *event)
 This is a default handler for the signal signal_button_press_event(). More...
 
virtual bool on_button_release_event (GdkEventButton *event)
 This is a default handler for the signal signal_button_release_event(). More...
 
virtual bool on_scroll_event (GdkEventScroll *event)
 This is a default handler for the signal signal_scroll_event(). More...
 
virtual bool on_motion_notify_event (GdkEventMotion *event)
 This is a default handler for the signal signal_motion_notify_event(). More...
 
virtual bool on_delete_event (GdkEventAny *event)
 This is a default handler for the signal signal_delete_event(). More...
 
virtual bool on_expose_event (GdkEventExpose *event)
 This is a default handler for the signal signal_expose_event(). More...
 
virtual bool on_key_press_event (GdkEventKey *event)
 This is a default handler for the signal signal_key_press_event(). More...
 
virtual bool on_key_release_event (GdkEventKey *event)
 This is a default handler for the signal signal_key_release_event(). More...
 
virtual bool on_enter_notify_event (GdkEventCrossing *event)
 This is a default handler for the signal signal_enter_notify_event(). More...
 
virtual bool on_leave_notify_event (GdkEventCrossing *event)
 This is a default handler for the signal signal_leave_notify_event(). More...
 
virtual bool on_configure_event (GdkEventConfigure *event)
 This is a default handler for the signal signal_configure_event(). More...
 
virtual bool on_focus_in_event (GdkEventFocus *event)
 This is a default handler for the signal signal_focus_in_event(). More...
 
virtual bool on_focus_out_event (GdkEventFocus *event)
 This is a default handler for the signal signal_focus_out_event(). More...
 
virtual bool on_map_event (GdkEventAny *event)
 This is a default handler for the signal signal_map_event(). More...
 
virtual bool on_unmap_event (GdkEventAny *event)
 This is a default handler for the signal signal_unmap_event(). More...
 
virtual bool on_property_notify_event (GdkEventProperty *event)
 This is a default handler for the signal signal_property_notify_event(). More...
 
virtual bool on_selection_clear_event (GdkEventSelection *event)
 This is a default handler for the signal signal_selection_clear_event(). More...
 
virtual bool on_selection_request_event (GdkEventSelection *event)
 This is a default handler for the signal signal_selection_request_event(). More...
 
virtual bool on_selection_notify_event (GdkEventSelection *event)
 This is a default handler for the signal signal_selection_notify_event(). More...
 
virtual bool on_proximity_in_event (GdkEventProximity *event)
 This is a default handler for the signal signal_proximity_in_event(). More...
 
virtual bool on_proximity_out_event (GdkEventProximity *event)
 This is a default handler for the signal signal_proximity_out_event(). More...
 
virtual bool on_visibility_notify_event (GdkEventVisibility *event)
 This is a default handler for the signal signal_visibility_notify_event(). More...
 
virtual bool on_client_event (GdkEventClient *event)
 This is a default handler for the signal signal_client_event(). More...
 
virtual bool on_no_expose_event (GdkEventAny *event)
 This is a default handler for the signal signal_no_expose_event(). More...
 
virtual bool on_window_state_event (GdkEventWindowState *event)
 This is a default handler for the signal signal_window_state_event(). More...
 
virtual void on_selection_get (SelectionData &selection_data, guint info, guint time)
 This is a default handler for the signal signal_selection_get(). More...
 
virtual void on_selection_received (const SelectionData &selection_data, guint time)
 This is a default handler for the signal signal_selection_received(). More...
 
virtual void on_drag_begin (const Glib::RefPtr< Gdk::DragContext > &context)
 This is a default handler for the signal signal_drag_begin(). More...
 
virtual void on_drag_end (const Glib::RefPtr< Gdk::DragContext > &context)
 This is a default handler for the signal signal_drag_end(). More...
 
virtual void on_drag_data_get (const Glib::RefPtr< Gdk::DragContext > &context, SelectionData &selection_data, guint info, guint time)
 This is a default handler for the signal signal_drag_data_get(). More...
 
virtual void on_drag_data_delete (const Glib::RefPtr< Gdk::DragContext > &context)
 This is a default handler for the signal signal_drag_data_delete(). More...
 
virtual void on_drag_leave (const Glib::RefPtr< Gdk::DragContext > &context, guint time)
 This is a default handler for the signal signal_drag_leave(). More...
 
virtual bool on_drag_motion (const Glib::RefPtr< Gdk::DragContext > &context, int x, int y, guint time)
 This is a default handler for the signal signal_drag_motion(). More...
 
virtual bool on_drag_drop (const Glib::RefPtr< Gdk::DragContext > &context, int x, int y, guint time)
 This is a default handler for the signal signal_drag_drop(). More...
 
virtual void on_drag_data_received (const Glib::RefPtr< Gdk::DragContext > &context, int x, int y, const SelectionData &selection_data, guint info, guint time)
 This is a default handler for the signal signal_drag_data_received(). More...
 
virtual bool on_touch_begin_event (GdkEventTouch *event)
 
virtual bool on_touch_update_event (GdkEventTouch *event)
 
virtual bool on_touch_end_event (GdkEventTouch *event)
 
virtual void on_screen_changed (const Glib::RefPtr< Gdk::Screen > &previous_screen)
 This is a default handler for the signal signal_screen_changed(). More...
 
virtual void dispatch_child_properties_changed_vfunc (guint p1, GParamSpec **p2)
 
virtual void show_all_vfunc ()
 
virtual void hide_all_vfunc ()
 
 Widget ()
 
void realize ()
 
void unrealize ()
 
void set_mapped (bool mapped=true)
 
void set_realized (bool realized=true)
 
void style_attach ()
 
void get_child_requisition (Requisition &requisition) const
 
void get_style_property_value (const Glib::ustring &the_property_name, Glib::ValueBase &value) const
 
void realize_if_needed ()
 

Friends

class Main
 

Related Functions

(Note that these are not member functions.)

Gtk::Widgetwrap (GtkWidget *object, bool take_copy=false)
 

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.

Definition at line 331 of file tk/ytkmm/ytkmm/gtkmm/widget.h.

Constructor & Destructor Documentation

◆ ~Widget()

virtual Gtk::Widget::~Widget ( )
virtual

◆ Widget()

Gtk::Widget::Widget ( )
protected

Member Function Documentation

◆ activate()

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.

◆ add_accelerator()

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.

◆ add_events()

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.

◆ add_mnemonic_label()

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.

Parameters
labelA Gtk::Widget that acts as a mnemonic label for widget.

◆ add_modal_grab()

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.

◆ app_paintable()

bool Gtk::Widget::app_paintable ( ) const

◆ can_default()

bool Gtk::Widget::can_default ( ) const

Determines whether widget can be a default widget. See set_can_default().

Returns
true if widget can be a default widget, false otherwise.

◆ can_focus()

bool Gtk::Widget::can_focus ( ) const

Determines whether widget can own the input focus. See set_can_focus().

Returns
true if widget can own the input focus, false otherwise.

◆ child_focus()

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

The default signal_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.

This function replaces gtk_container_focus() from GTK+ 1.2.
It was necessary to check that the child was visible, sensitive, and focusable before calling gtk_container_focus(). child_focus() returns false if the widget is not currently in a focusable state, so there's no need for those checks.

Parameters
directionDirection of focus movement.
Returns
true if focus ended up inside widget.

◆ child_notify()

void Gtk::Widget::child_notify ( const Glib::ustring &  child_property)

Emits a Gtk::Widget::signal_child_notify() signal for the child property child_property on widget.

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

Parameters
child_propertyThe name of a child property installed on the class of widget's parent.

◆ class_path()

void Gtk::Widget::class_path ( Glib::ustring &  path,
Glib::ustring &  path_reversed 
)

◆ create_pango_context()

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.

◆ create_pango_layout()

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::signal_style_set() and Gtk::Widget::signal_direction_changed() signals for the widget.

Parameters
textText to set on the layout (can be 0).
Returns
The new Pango::Layout.

◆ dispatch_child_properties_changed_vfunc()

virtual void Gtk::Widget::dispatch_child_properties_changed_vfunc ( guint  p1,
GParamSpec **  p2 
)
protectedvirtual

◆ double_buffered()

bool Gtk::Widget::double_buffered ( ) const

◆ drag_begin()

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 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 button-press-event handler.
  2. During a 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 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.

◆ drag_check_threshold()

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.

◆ drag_dest_add_image_targets()

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

Parameters
widgetA Gtk::Widget that's a drag destination.

◆ drag_dest_add_text_targets()

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

Parameters
widgetA Gtk::Widget that's a drag destination.

◆ drag_dest_add_uri_targets()

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

Parameters
widgetA Gtk::Widget that's a drag destination.

◆ drag_dest_find_target() [1/2]

Glib::ustring Gtk::Widget::drag_dest_find_target ( const Glib::RefPtr< Gdk::DragContext > &  context) const

◆ drag_dest_find_target() [2/2]

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.

◆ drag_dest_get_target_list() [1/2]

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.

◆ drag_dest_get_target_list() [2/2]

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.

◆ drag_dest_set() [1/2]

void Gtk::Widget::drag_dest_set ( const ArrayHandle_TargetEntry targets,
DestDefaults  flags = DEST_DEFAULT_ALL,
Gdk::DragAction  actions = Gdk::ACTION_COPY 
)

◆ drag_dest_set() [2/2]

void Gtk::Widget::drag_dest_set ( DestDefaults  flags = DestDefaults(0),
Gdk::DragAction  actions = Gdk::DragAction(0) 
)

◆ drag_dest_set_proxy()

void Gtk::Widget::drag_dest_set_proxy ( const Glib::RefPtr< Gdk::Window > &  proxy_window,
Gdk::DragProtocol  protocol,
bool  use_coordinates 
)

◆ drag_dest_set_target_list()

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.

◆ drag_dest_unset()

void Gtk::Widget::drag_dest_unset ( )

◆ drag_get_data() [1/2]

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

◆ drag_get_data() [2/2]

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

◆ drag_get_source_widget()

static Widget* Gtk::Widget::drag_get_source_widget ( const Glib::RefPtr< Gdk::DragContext > &  context)
static

◆ drag_highlight()

void Gtk::Widget::drag_highlight ( )

◆ drag_set_as_icon()

void Gtk::Widget::drag_set_as_icon ( const Glib::RefPtr< Gdk::DragContext > &  context,
int  hot_x,
int  hot_y 
)

◆ drag_source_add_image_targets()

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

Parameters
widgetA Gtk::Widget that's is a drag source.

◆ drag_source_add_text_targets()

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

Parameters
widgetA Gtk::Widget that's is a drag source.

◆ drag_source_add_uri_targets()

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

Parameters
widgetA Gtk::Widget that's is a drag source.

◆ drag_source_set()

void Gtk::Widget::drag_source_set ( const ArrayHandle_TargetEntry targets,
Gdk::ModifierType  start_button_mask = Gdk::MODIFIER_MASK,
Gdk::DragAction  actions = Gdk::ACTION_COPY 
)

◆ drag_source_set_icon() [1/4]

void Gtk::Widget::drag_source_set_icon ( const Glib::RefPtr< Gdk::Colormap > &  colormap,
const Glib::RefPtr< Gdk::Pixmap > &  pixmap,
const Glib::RefPtr< Gdk::Bitmap > &  mask 
)

Sets the icon that will be used for drags from a particular widget from a pixmap/mask. GTK+ retains references for the arguments, and will release them when they are no longer needed. Use set_icon_pixbuf() instead.

Parameters
colormapThe colormap of the icon.
pixmapThe image data for the icon.
maskThe transparency mask for an image.

◆ drag_source_set_icon() [2/4]

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.

◆ drag_source_set_icon() [3/4]

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.

Parameters
icon_nameName of icon to use.

◆ drag_source_set_icon() [4/4]

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.

◆ drag_source_unset()

void Gtk::Widget::drag_source_unset ( )

◆ drag_unhighlight()

void Gtk::Widget::drag_unhighlight ( )

◆ draw_insertion_cursor()

void Gtk::Widget::draw_insertion_cursor ( Glib::RefPtr< Gdk::Drawable drawable,
const Gdk::Rectangle area,
const Gdk::Rectangle location,
bool  is_primary,
TextDirection  direction,
bool  draw_arrow = true 
)

◆ ensure_style()

void Gtk::Widget::ensure_style ( )

Ensures that widget has a style ( widget->style). Not a very useful function; most of the time, if you want the style, the widget is realized, and realized widgets are guaranteed to have a style already.

◆ error_bell()

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.

◆ event()

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

◆ freeze_child_notify()

void Gtk::Widget::freeze_child_notify ( )

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

◆ get_action() [1/2]

Glib::RefPtr<Action> Gtk::Widget::get_action ( )

Returns the Gtk::Action that widget is a proxy for. See also Gtk::Action::get_proxies().

Deprecated: 2.16: Use Gtk::Activatable::get_related_action() instead.

Returns
The action that a widget is a proxy for, or 0, if it is not attached to an action.

◆ get_action() [2/2]

Glib::RefPtr<const Action> Gtk::Widget::get_action ( ) const

Returns the Gtk::Action that widget is a proxy for. See also Gtk::Action::get_proxies().

Deprecated: 2.16: Use Gtk::Activatable::get_related_action() instead.

Returns
The action that a widget is a proxy for, or 0, if it is not attached to an action.

◆ get_allocation()

Allocation Gtk::Widget::get_allocation ( ) const

Retrieves the widget's location.

Returns
The widget's allocated area.

◆ get_ancestor() [1/2]

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.

◆ get_ancestor() [2/2]

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.

◆ get_app_paintable()

bool Gtk::Widget::get_app_paintable ( ) const

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

See set_app_paintable()

Returns
true if the widget is app paintable.

◆ get_can_default()

bool Gtk::Widget::get_can_default ( ) const

Determines whether widget can be a default widget. See set_can_default().

Returns
true if widget can be a default widget, false otherwise.

◆ get_can_focus()

bool Gtk::Widget::get_can_focus ( ) const

Determines whether widget can own the input focus. See set_can_focus().

Returns
true if widget can own the input focus, false otherwise.

◆ get_child_requisition()

void Gtk::Widget::get_child_requisition ( Requisition requisition) const
protected

This function is only for use in widget implementations. Obtains widget->requisition, unless someone has forced a particular geometry on the widget (e.g. with set_size_request()), in which case it returns that geometry instead of the widget's requisition.

This function differs from size_request() in that it retrieves the last size request value from widget->requisition, while size_request() actually calls the "size_request" method on widget to compute the size request and fill in widget->requisition, and only then returns widget->requisition.

Because this function does not call the "size_request" method, it can only be used when you know that widget->requisition is up-to-date, that is, size_request() has been called since the last time a resize was queued. In general, only container implementations have this information; applications should use size_request().

Parameters
requisitionA Gtk::Requisition to be filled in.

◆ get_child_visible()

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.

◆ get_clipboard() [1/2]

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.

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.

◆ get_clipboard() [2/2]

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.

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.

◆ get_colormap()

Glib::RefPtr<Gdk::Colormap> Gtk::Widget::get_colormap ( )

Gets the colormap that will be used to render widget. No reference will be added to the returned colormap; it should not be unreferenced.

Returns
The colormap used by widget.

◆ get_composite_name()

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.

◆ get_current_modal_grab()

static Widget* Gtk::Widget::get_current_modal_grab ( )
static

Retrieve the widget which is currently grabbing all events.

◆ get_default_colormap()

static Glib::RefPtr<Gdk::Colormap> Gtk::Widget::get_default_colormap ( )
static

Obtains the default colormap used to create widgets.

Returns
Default widget colormap.

◆ get_default_direction()

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

Obtains the current default reading direction. See set_default_direction().

Returns
The current default direction.

◆ get_default_style()

static Glib::RefPtr<Style> Gtk::Widget::get_default_style ( )
static

Returns the default style used by all widgets initially.

Returns
The default style. This Gtk::Style object is owned by GTK+ and should not be modified or freed.

◆ get_default_visual()

static Glib::RefPtr<Gdk::Visual> Gtk::Widget::get_default_visual ( )
static

Obtains the visual of the default colormap. Not really useful; used to be useful before gdk_colormap_get_visual() existed.

Returns
Visual of the default colormap.

◆ get_direction() [1/2]

TextDirection Gtk::Widget::get_direction ( )

Gets the reading direction for a particular widget. See set_direction().

Returns
The reading direction for the widget.

◆ get_direction() [2/2]

TextDirection Gtk::Widget::get_direction ( ) const

Gets the reading direction for a particular widget. See set_direction().

Returns
The reading direction for the widget.

◆ get_display() [1/2]

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.

Returns
The Gdk::Display for the toplevel for this widget.

◆ get_display() [2/2]

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.

Returns
The Gdk::Display for the toplevel for this widget.

◆ get_double_buffered()

bool Gtk::Widget::get_double_buffered ( ) const

Determines whether the widget is double buffered.

See set_double_buffered()

Returns
true if the widget is double buffered.

◆ get_events()

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.

◆ get_extension_events()

Gdk::ExtensionMode Gtk::Widget::get_extension_events ( ) const

Retrieves the extension events the widget will receive; see gdk_input_set_extension_events().

Returns
Extension events for widget.

◆ get_flags()

WidgetFlags Gtk::Widget::get_flags ( ) const

◆ get_has_tooltip()

bool Gtk::Widget::get_has_tooltip ( ) const

Returns the current value of the has-tooltip property. See GtkWidget:has-tooltip for more information.

Returns
Current value of has-tooltip on widget.

◆ get_has_window()

bool Gtk::Widget::get_has_window ( ) const

Determines whether widget has a Gdk::Window of its own. See set_has_window().

Returns
true if widget has a window, false otherwise.

◆ get_height()

int Gtk::Widget::get_height ( ) const

◆ get_is_drawable()

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.

Returns
true if widget is drawable, false otherwise.

◆ get_is_toplevel()

bool Gtk::Widget::get_is_toplevel ( ) const

Determines whether widget is a toplevel widget. Currently only Gtk::Window and Gtk::Invisible are toplevel widgets. Toplevel widgets have no parent widget.

Returns
true if widget is a toplevel, false otherwise.

◆ get_mapped()

bool Gtk::Widget::get_mapped ( ) const

Whether the widget is mapped.

Returns
true if the widget is mapped, false otherwise.

◆ get_modifier_style() [1/2]

Glib::RefPtr<RcStyle> Gtk::Widget::get_modifier_style ( )

Returns the current modifier style for the widget. (As set by modify_style().) If no style has previously set, a new Gtk::RcStyle will be created with all values unset, and set as the modifier style for the widget. If you make changes to this rc style, you must call modify_style(), passing in the returned rc style, to make sure that your changes take effect.

Caution: passing the style back to modify_style() will normally end up destroying it, because modify_style() copies the passed-in style and sets the copy as the new modifier style, thus dropping any reference to the old modifier style. Add a reference to the modifier style if you want to keep it alive.

Returns
The modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using Glib::object_ref().

◆ get_modifier_style() [2/2]

Glib::RefPtr<const RcStyle> Gtk::Widget::get_modifier_style ( ) const

Returns the current modifier style for the widget. (As set by modify_style().) If no style has previously set, a new Gtk::RcStyle will be created with all values unset, and set as the modifier style for the widget. If you make changes to this rc style, you must call modify_style(), passing in the returned rc style, to make sure that your changes take effect.

Caution: passing the style back to modify_style() will normally end up destroying it, because modify_style() copies the passed-in style and sets the copy as the new modifier style, thus dropping any reference to the old modifier style. Add a reference to the modifier style if you want to keep it alive.

Returns
The modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using Glib::object_ref().

◆ get_name()

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.

◆ get_no_show_all()

bool Gtk::Widget::get_no_show_all ( ) const

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

Returns
The current value of the "no-show-all" property.

◆ get_pango_context()

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::signal_style_set() and Gtk::Widget::signal_direction_changed() signals for the widget.

Returns
The Pango::Context for the widget.

◆ get_parent() [1/2]

Container* Gtk::Widget::get_parent ( )

Returns the parent container of widget.

Returns
The parent container of widget, or 0.

◆ get_parent() [2/2]

const Container* Gtk::Widget::get_parent ( ) const

Returns the parent container of widget.

Returns
The parent container of widget, or 0.

◆ get_parent_window() [1/2]

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

Gets widget's parent window.

Returns
The parent window of widget.

◆ get_parent_window() [2/2]

Glib::RefPtr<const Gdk::Window> Gtk::Widget::get_parent_window ( ) const

Gets widget's parent window.

Returns
The parent window of widget.

◆ get_pointer()

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.

Parameters
xReturn location for the X coordinate, or 0.
yReturn location for the Y coordinate, or 0.

◆ get_realized()

bool Gtk::Widget::get_realized ( ) const

Determines whether widget is realized.

Returns
true if widget is realized, false otherwise.

◆ get_receives_default()

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

Returns
true if widget acts as default widget when focussed, false otherwise.

◆ get_requisition()

Requisition Gtk::Widget::get_requisition ( ) const

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.

◆ get_root_window() [1/2]

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.

Returns
The Gdk::Window root window for the toplevel for this widget.

◆ get_root_window() [2/2]

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.

Returns
The Gdk::Window root window for the toplevel for this widget.

◆ get_saved_state()

Gtk::StateType Gtk::Widget::get_saved_state ( ) const

◆ get_screen() [1/2]

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.

Returns
The Gdk::Screen for the toplevel for this widget.

◆ get_screen() [2/2]

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.

Returns
The Gdk::Screen for the toplevel for this widget.

◆ get_sensitive()

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

Returns
true if the widget is sensitive.

◆ get_settings()

Glib::RefPtr<Settings> Gtk::Widget::get_settings ( )

Gets the settings object holding the settings (global property settings, RC file information, etc) used for this widget.

Note that this function can only be called when the Gtk::Widget is attached to a toplevel, since the settings object is specific to a particular Gdk::Screen.

Returns
The relevant Gtk::Settings object.

◆ get_size_request()

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

Parameters
widthReturn location for width, or 0.
heightReturn location for height, or 0.

◆ get_snapshot() [1/2]

Glib::RefPtr<Gdk::Pixmap> Gtk::Widget::get_snapshot ( ) const

Create a Gdk::Pixmap of the contents of the widget and its children.

Works even if the widget is obscured. The depth and visual of the resulting pixmap is dependent on the widget being snapshot and likely differs from those of a target widget displaying the pixmap. The function Gdk::Pixbuf::get_from_drawable() can be used to convert the pixmap to a visual independant representation.

The snapshot area used by this function is the widget's allocation plus any extra space occupied by additional windows belonging to this widget (such as the arrows of a spin button). Thus, the resulting snapshot pixmap is possibly larger than the allocation.

The returned pixmap can be empty.

Returns
A Gdk::Pixmap snapshot of the widget

◆ get_snapshot() [2/2]

Glib::RefPtr<Gdk::Pixmap> Gtk::Widget::get_snapshot ( Gdk::Rectangle clip_rect) const

Create a Gdk::Pixmap of the contents of the widget and its children.

Works even if the widget is obscured. The depth and visual of the resulting pixmap is dependent on the widget being snapshot and likely differs from those of a target widget displaying the pixmap. The function gdk_pixbuf_get_from_drawable() can be used to convert the pixmap to a visual independant representation.

The snapshot area used by this function is the widget's allocation plus any extra space occupied by additional windows belonging to this widget (such as the arrows of a spin button). Thus, the resulting snapshot pixmap is possibly larger than the allocation.

The resulting pixmap is shrunken to match the specified clip_rect. The (x,y) coordinates of clip_rect are interpreted widget relative. If width or height of clip_rect are 0 or negative, the width or height of the resulting pixmap will be shrunken by the respective amount. For instance a clip_rect { +5, +5, -10, -10 } will chop off 5 pixels at each side of the snapshot pixmap. If non-0, clip_rect will contain the exact widget-relative snapshot coordinates upon return. A clip_rect of { -1, -1, 0, 0 } can be used to preserve the auto-grown snapshot area and use clip_rect as a pure output parameter.

The returned pixmap can be an empty RefPtr, if the resulting clip_area was empty.

Parameters
clip_rectA Gdk::Rectangle.
Returns
Gdk::Pixmap snapshot of the widget

◆ get_state()

StateType Gtk::Widget::get_state ( ) const

Returns the widget's state. See set_state().

Returns
The state of widget.

◆ get_style() [1/2]

Glib::RefPtr<Style> Gtk::Widget::get_style ( )

Simply an accessor function that returns widget->style.

Returns
The widget's Gtk::Style.

◆ get_style() [2/2]

Glib::RefPtr<const Style> Gtk::Widget::get_style ( ) const

Simply an accessor function that returns widget->style.

Returns
The widget's Gtk::Style.

◆ get_style_property()

template<class PropertyType >
void Gtk::Widget::get_style_property ( const Glib::ustring &  the_property_name,
PropertyType &  value 
) const

◆ get_style_property_value()

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.

◆ get_tooltip_markup()

Glib::ustring Gtk::Widget::get_tooltip_markup ( ) const

Gets the contents of the tooltip for widget.

Returns
The tooltip text.

◆ get_tooltip_text()

Glib::ustring Gtk::Widget::get_tooltip_text ( ) const

Gets the contents of the tooltip for widget.

Returns
The tooltip text.

◆ get_tooltip_window()

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

Returns
The Gtk::Window of the current tooltip.

◆ get_toplevel() [1/2]

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.

[C example ellipted]

Returns
The topmost ancestor of widget, or widget itself if there's no ancestor.

◆ get_toplevel() [2/2]

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.

[C example ellipted]

Returns
The topmost ancestor of widget, or widget itself if there's no ancestor.

◆ get_visible()

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

Returns
true if the widget is visible.

◆ get_visual()

Glib::RefPtr<Gdk::Visual> Gtk::Widget::get_visual ( )

Gets the visual that will be used to render widget.

Returns
The visual for widget.

◆ get_width()

int Gtk::Widget::get_width ( ) const

◆ get_window() [1/2]

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

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

Returns
widget's window.

◆ get_window() [2/2]

Glib::RefPtr<const Gdk::Window> Gtk::Widget::get_window ( ) const

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

Returns
widget's window.

◆ gobj() [1/2]

GtkWidget* Gtk::Widget::gobj ( )
inline

Provides access to the underlying C GtkObject.

Definition at line 372 of file tk/ytkmm/ytkmm/gtkmm/widget.h.

◆ gobj() [2/2]

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

Provides access to the underlying C GtkObject.

Definition at line 375 of file tk/ytkmm/ytkmm/gtkmm/widget.h.

◆ grab_default()

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.

◆ grab_focus()

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.

◆ has_default()

bool Gtk::Widget::has_default ( ) const

Determines whether widget is the current default widget within its toplevel. See set_can_default().

Returns
true if widget is the current default widget within its toplevel, false otherwise.

◆ has_focus()

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.

Returns
true if the widget has the global input focus.

◆ has_grab()

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

Returns
true if the widget is in the grab_widgets stack.

◆ has_no_window()

bool Gtk::Widget::has_no_window ( ) const

◆ has_rc_style()

bool Gtk::Widget::has_rc_style ( ) const

Determines if the widget style has been looked up through the rc mechanism.

Returns
true if the widget has been looked up through the rc mechanism, false otherwise.

◆ has_screen()

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.

Returns
true if there is a Gdk::Screen associcated with the widget.

◆ hide()

void Gtk::Widget::hide ( )

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

◆ hide_all()

void Gtk::Widget::hide_all ( )

Recursively hides a widget and any child widgets.

Deprecated: 2.24: Use hide() instead.

◆ hide_all_vfunc()

virtual void Gtk::Widget::hide_all_vfunc ( )
protectedvirtual

◆ input_shape_combine_mask()

void Gtk::Widget::input_shape_combine_mask ( const Glib::RefPtr< const Gdk::Bitmap > &  shape_mask,
int  offset_x,
int  offset_y 
)

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_mask() for more information.

Parameters
shape_maskShape to be added, or 0 to remove an existing shape.
offset_xX position of shape mask with respect to window.
offset_yY position of shape mask with respect to window.

◆ intersect() [1/2]

bool Gtk::Widget::intersect ( const Gdk::Rectangle area) const

◆ intersect() [2/2]

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.

◆ is_ancestor()

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.

◆ is_composite_child()

bool Gtk::Widget::is_composite_child ( ) const

Returns trye if the widget is a composite child of its parent.

◆ is_composited()

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

Returns
true if the widget can rely on its alpha channel being drawn correctly.

◆ is_drawable()

bool Gtk::Widget::is_drawable ( ) const

◆ is_focus()

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.

◆ is_mapped()

bool Gtk::Widget::is_mapped ( ) const

◆ is_realized()

bool Gtk::Widget::is_realized ( ) const

◆ is_sensitive()

bool Gtk::Widget::is_sensitive ( ) const

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

Returns
true if the widget is effectively sensitive.

◆ is_toplevel()

bool Gtk::Widget::is_toplevel ( ) const

◆ is_visible()

bool Gtk::Widget::is_visible ( ) const

◆ keynav_failed()

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::signal_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 signal_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::property_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 signal_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.

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

◆ list_mnemonic_labels() [1/2]

Glib::ListHandle<Widget*> Gtk::Widget::list_mnemonic_labels ( )

Returns a newly allocated list of the widgets, normally labels, for which this widget is a 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.

Returns
The list of mnemonic labels; free this list with Glib::list_free() when you are done with it.

◆ list_mnemonic_labels() [2/2]

Glib::ListHandle<const Widget*> Gtk::Widget::list_mnemonic_labels ( ) const

Returns a newly allocated list of the widgets, normally labels, for which this widget is a 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.

Returns
The list of mnemonic labels; free this list with Glib::list_free() when you are done with it.

◆ map()

void Gtk::Widget::map ( )

This function is only for use in widget implementations. Causes a widget to be mapped if it isn't already.

◆ mnemonic_activate()

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

Emits the Gtk::Widget::signal_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.

◆ modify_base()

void Gtk::Widget::modify_base ( StateType  state,
const Gdk::Color color 
)

Sets the base color for a widget in a particular state. All other style values are left untouched. The base color is the background color used along with the text color (see modify_text() ) for widgets such as Gtk::Entry and Gtk::TextView. See also modify_style() and unset_base().

Parameters
stateThe state for which to set the text color.
colorThe color to assign (does not need to be allocated).

◆ modify_bg()

void Gtk::Widget::modify_bg ( StateType  state,
const Gdk::Color color 
)

Sets the background color for a widget in a particular state. All other style values are left untouched. See also modify_style() and unset_bg().

Parameters
stateThe state for which to set the background color.
colorThe color to assign (does not need to be allocated).

◆ modify_bg_pixmap()

void Gtk::Widget::modify_bg_pixmap ( StateType  state,
const Glib::ustring &  pixmap_name 
)

◆ modify_cursor()

void Gtk::Widget::modify_cursor ( const Gdk::Color primary,
const Gdk::Color secondary 
)

Sets the cursor color to use in a widget, overriding the cursor_color and secondary_cursor_color style properties. All other style values are left untouched. See also modify_style(). See also unset_cursor().

Parameters
primarythe color to use for primary cursor (does not need to be allocated).
secondarythe color to use for secondary cursor (does not need to be allocated).

◆ modify_fg()

void Gtk::Widget::modify_fg ( StateType  state,
const Gdk::Color color 
)

Sets the foreground color for a widget in a particular state. All other style values are left untouched. See also modify_style() and unset_fg().

Parameters
stateThe state for which to set the foreground color.
colorThe color to assign (does not need to be allocated).

◆ modify_font()

void Gtk::Widget::modify_font ( const Pango::FontDescription &  font_desc)

Sets the font to use for a widget. All other style values are left untouched. See also modify_style() and unset_font().

◆ modify_style()

void Gtk::Widget::modify_style ( const Glib::RefPtr< RcStyle > &  style)

Modifies style values on the widget. Modifications made using this technique take precedence over style values set via an RC file, however, they will be overriden if a style is explicitely set on the widget using set_style(). The Gtk::RcStyle structure is designed so each field can either be set or unset, so it is possible, using this function, to modify some style values and leave the others unchanged.

Note that modifications made with this function are not cumulative with previous calls to modify_style() or with such functions as modify_fg(). If you wish to retain previous values, you must first call get_modifier_style(), make your modifications to the returned style, then call modify_style() with that style. On the other hand, if you first call modify_style(), subsequent calls to such functions modify_fg() will have a cumulative effect with the initial modifications.

Parameters
styleThe Gtk::RcStyle holding the style modifications.

◆ modify_text()

void Gtk::Widget::modify_text ( StateType  state,
const Gdk::Color color 
)

Sets the text color for a widget in a particular state. All other style values are left untouched. The text color is the foreground color used along with the base color (see modify_base() ) for widgets such as Gtk::Entry and Gtk::TextView. See also modify_style() and unset_text().

Parameters
stateThe state for which to set the text color.
colorThe color to assign (does not need to be allocated).

◆ on_button_press_event()

◆ on_button_release_event()

◆ on_child_notify()

virtual void Gtk::Widget::on_child_notify ( GParamSpec *  pspec)
protectedvirtual

This is a default handler for the signal signal_child_notify().

◆ on_client_event()

virtual bool Gtk::Widget::on_client_event ( GdkEventClient event)
protectedvirtual

This is a default handler for the signal signal_client_event().

◆ on_configure_event()

virtual bool Gtk::Widget::on_configure_event ( GdkEventConfigure event)
protectedvirtual

This is a default handler for the signal signal_configure_event().

Reimplemented in Meterbridge.

◆ on_delete_event()

virtual bool Gtk::Widget::on_delete_event ( GdkEventAny event)
protectedvirtual

◆ on_direction_changed()

virtual void Gtk::Widget::on_direction_changed ( TextDirection  direction)
protectedvirtual

This is a default handler for the signal signal_direction_changed().

◆ on_drag_begin()

virtual void Gtk::Widget::on_drag_begin ( const Glib::RefPtr< Gdk::DragContext > &  context)
protectedvirtual

This is a default handler for the signal signal_drag_begin().

Reimplemented in Gtkmm2ext::DnDTreeViewBase.

◆ on_drag_data_delete()

virtual void Gtk::Widget::on_drag_data_delete ( const Glib::RefPtr< Gdk::DragContext > &  context)
protectedvirtual

This is a default handler for the signal signal_drag_data_delete().

◆ on_drag_data_get()

virtual void Gtk::Widget::on_drag_data_get ( const Glib::RefPtr< Gdk::DragContext > &  context,
SelectionData selection_data,
guint  info,
guint  time 
)
protectedvirtual

◆ on_drag_data_received()

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

◆ on_drag_drop()

virtual bool Gtk::Widget::on_drag_drop ( const Glib::RefPtr< Gdk::DragContext > &  context,
int  x,
int  y,
guint  time 
)
protectedvirtual

This is a default handler for the signal signal_drag_drop().

Reimplemented in Gtkmm2ext::DnDTreeViewBase.

◆ on_drag_end()

virtual void Gtk::Widget::on_drag_end ( const Glib::RefPtr< Gdk::DragContext > &  context)
protectedvirtual

This is a default handler for the signal signal_drag_end().

Reimplemented in Gtkmm2ext::DnDTreeViewBase.

◆ on_drag_leave()

virtual void Gtk::Widget::on_drag_leave ( const Glib::RefPtr< Gdk::DragContext > &  context,
guint  time 
)
protectedvirtual

This is a default handler for the signal signal_drag_leave().

Reimplemented in Gtkmm2ext::DnDTreeViewBase.

◆ on_drag_motion()

virtual bool Gtk::Widget::on_drag_motion ( const Glib::RefPtr< Gdk::DragContext > &  context,
int  x,
int  y,
guint  time 
)
protectedvirtual

This is a default handler for the signal signal_drag_motion().

Reimplemented in Gtkmm2ext::DnDTreeViewBase.

◆ on_enter_notify_event()

◆ on_event()

virtual bool Gtk::Widget::on_event ( GdkEvent event)
protectedvirtual

This is a default handler for the signal signal_event().

◆ on_expose_event()

◆ on_focus()

virtual bool Gtk::Widget::on_focus ( DirectionType  direction)
protectedvirtual

This is a default handler for the signal signal_focus().

◆ on_focus_in_event()

virtual bool Gtk::Widget::on_focus_in_event ( GdkEventFocus event)
protectedvirtual

◆ on_focus_out_event()

virtual bool Gtk::Widget::on_focus_out_event ( GdkEventFocus event)
protectedvirtual

◆ on_grab_focus()

virtual void Gtk::Widget::on_grab_focus ( )
protectedvirtual

This is a default handler for the signal signal_grab_focus().

◆ on_grab_notify()

virtual void Gtk::Widget::on_grab_notify ( bool  was_grabbed)
protectedvirtual

This is a default handler for the signal signal_grab_notify().

◆ on_hide()

◆ on_hierarchy_changed()

virtual void Gtk::Widget::on_hierarchy_changed ( Widget previous_toplevel)
protectedvirtual

This is a default handler for the signal signal_hierarchy_changed().

◆ on_key_press_event()

◆ on_key_release_event()

◆ on_leave_notify_event()

◆ on_map()

virtual void Gtk::Widget::on_map ( )
protectedvirtual

◆ on_map_event()

virtual bool Gtk::Widget::on_map_event ( GdkEventAny event)
protectedvirtual

This is a default handler for the signal signal_map_event().

Reimplemented in Splash.

◆ on_mnemonic_activate()

virtual bool Gtk::Widget::on_mnemonic_activate ( bool  group_cycling)
protectedvirtual

This is a default handler for the signal signal_mnemonic_activate().

◆ on_motion_notify_event()

◆ on_no_expose_event()

virtual bool Gtk::Widget::on_no_expose_event ( GdkEventAny event)
protectedvirtual

This is a default handler for the signal signal_no_expose_event().

◆ on_parent_changed()

virtual void Gtk::Widget::on_parent_changed ( Widget previous_parent)
protectedvirtual

This is a default handler for the signal signal_parent_changed().

Reimplemented in ApplicationBar.

◆ on_property_notify_event()

virtual bool Gtk::Widget::on_property_notify_event ( GdkEventProperty event)
protectedvirtual

This is a default handler for the signal signal_property_notify_event().

◆ on_proximity_in_event()

virtual bool Gtk::Widget::on_proximity_in_event ( GdkEventProximity event)
protectedvirtual

This is a default handler for the signal signal_proximity_in_event().

◆ on_proximity_out_event()

virtual bool Gtk::Widget::on_proximity_out_event ( GdkEventProximity event)
protectedvirtual

This is a default handler for the signal signal_proximity_out_event().

◆ on_realize()

◆ on_screen_changed()

virtual void Gtk::Widget::on_screen_changed ( const Glib::RefPtr< Gdk::Screen > &  previous_screen)
protectedvirtual

This is a default handler for the signal signal_screen_changed().

◆ on_scroll_event()

◆ on_selection_clear_event()

virtual bool Gtk::Widget::on_selection_clear_event ( GdkEventSelection event)
protectedvirtual

This is a default handler for the signal signal_selection_clear_event().

◆ on_selection_get()

virtual void Gtk::Widget::on_selection_get ( SelectionData selection_data,
guint  info,
guint  time 
)
protectedvirtual

This is a default handler for the signal signal_selection_get().

◆ on_selection_notify_event()

virtual bool Gtk::Widget::on_selection_notify_event ( GdkEventSelection event)
protectedvirtual

This is a default handler for the signal signal_selection_notify_event().

◆ on_selection_received()

virtual void Gtk::Widget::on_selection_received ( const SelectionData selection_data,
guint  time 
)
protectedvirtual

This is a default handler for the signal signal_selection_received().

◆ on_selection_request_event()

virtual bool Gtk::Widget::on_selection_request_event ( GdkEventSelection event)
protectedvirtual

This is a default handler for the signal signal_selection_request_event().

◆ on_show()

◆ on_size_allocate()

◆ on_size_request()

◆ on_state_changed()

virtual void Gtk::Widget::on_state_changed ( Gtk::StateType  previous_state)
protectedvirtual

◆ on_style_changed()

virtual void Gtk::Widget::on_style_changed ( const Glib::RefPtr< Gtk::Style > &  previous_style)
protectedvirtual

This is a default handler for the signal signal_style_changed().

◆ on_touch_begin_event()

virtual bool Gtk::Widget::on_touch_begin_event ( GdkEventTouch event)
protectedvirtual

◆ on_touch_end_event()

virtual bool Gtk::Widget::on_touch_end_event ( GdkEventTouch event)
protectedvirtual

◆ on_touch_update_event()

virtual bool Gtk::Widget::on_touch_update_event ( GdkEventTouch event)
protectedvirtual

◆ on_unmap()

◆ on_unmap_event()

virtual bool Gtk::Widget::on_unmap_event ( GdkEventAny event)
protectedvirtual

This is a default handler for the signal signal_unmap_event().

◆ on_unrealize()

virtual void Gtk::Widget::on_unrealize ( )
protectedvirtual

This is a default handler for the signal signal_unrealize().

◆ on_visibility_notify_event()

virtual bool Gtk::Widget::on_visibility_notify_event ( GdkEventVisibility event)
protectedvirtual

This is a default handler for the signal signal_visibility_notify_event().

Reimplemented in ArdourCanvas::GtkCanvas.

◆ on_window_state_event()

virtual bool Gtk::Widget::on_window_state_event ( GdkEventWindowState event)
protectedvirtual

This is a default handler for the signal signal_window_state_event().

◆ parent_sensitive()

bool Gtk::Widget::parent_sensitive ( ) const

◆ path()

void Gtk::Widget::path ( Glib::ustring &  path,
Glib::ustring &  path_reversed 
)

Compute a widget's path of the form "GtkWindow.MyLabel".

◆ pop_colormap()

static void Gtk::Widget::pop_colormap ( )
static

Removes a colormap pushed with push_colormap().

◆ pop_composite_child()

static void Gtk::Widget::pop_composite_child ( )
static

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

◆ property_app_paintable() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_app_paintable ( )

Whether the application will paint directly on the widget.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_app_paintable() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_app_paintable ( ) const

Whether the application will paint directly on the widget.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_can_default() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_can_default ( )

Whether the widget can be the default widget.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_can_default() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_can_default ( ) const

Whether the widget can be the default widget.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_can_focus() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_can_focus ( )

Whether the widget can accept the input focus.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_can_focus() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_can_focus ( ) const

Whether the widget can accept the input focus.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_composite_child()

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_composite_child ( ) const

Whether the widget is part of a composite widget.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_double_buffered() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_double_buffered ( )

Whether or not the widget is double buffered.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_double_buffered() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_double_buffered ( ) const

Whether or not the widget is double buffered.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_events() [1/2]

Glib::PropertyProxy< Gdk::EventMask > Gtk::Widget::property_events ( )

The event mask that decides what kind of GdkEvents this widget gets.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_events() [2/2]

Glib::PropertyProxy_ReadOnly< Gdk::EventMask > Gtk::Widget::property_events ( ) const

The event mask that decides what kind of GdkEvents this widget gets.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_extension_events() [1/2]

Glib::PropertyProxy< Gdk::ExtensionMode > Gtk::Widget::property_extension_events ( )

The mask that decides what kind of extension events this widget gets.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_extension_events() [2/2]

Glib::PropertyProxy_ReadOnly< Gdk::ExtensionMode > Gtk::Widget::property_extension_events ( ) const

The mask that decides what kind of extension events this widget gets.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_has_default() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_has_default ( )

Whether the widget is the default widget.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_has_default() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_has_default ( ) const

Whether the widget is the default widget.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_has_focus() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_has_focus ( )

Whether the widget has the input focus.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_has_focus() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_has_focus ( ) const

Whether the widget has the input focus.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_has_tooltip() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_has_tooltip ( )

Whether this widget has a tooltip.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_has_tooltip() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_has_tooltip ( ) const

Whether this widget has a tooltip.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_height_request() [1/2]

Glib::PropertyProxy< int > Gtk::Widget::property_height_request ( )

Override for height request of the widget, or -1 if natural request should be used.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_height_request() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gtk::Widget::property_height_request ( ) const

Override for height request of the widget, or -1 if natural request should be used.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_is_focus() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_is_focus ( )

Whether the widget is the focus widget within the toplevel.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_is_focus() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_is_focus ( ) const

Whether the widget is the focus widget within the toplevel.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_name() [1/2]

Glib::PropertyProxy< Glib::ustring > Gtk::Widget::property_name ( )

The name of the widget.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_name() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::Widget::property_name ( ) const

The name of the widget.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_no_show_all() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_no_show_all ( )

Whether gtk_widget_show_all() should not affect this widget.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_no_show_all() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_no_show_all ( ) const

Whether gtk_widget_show_all() should not affect this widget.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_parent() [1/2]

Glib::PropertyProxy< Container* > Gtk::Widget::property_parent ( )

The parent widget of this widget. Must be a Container widget.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_parent() [2/2]

Glib::PropertyProxy_ReadOnly< Container* > Gtk::Widget::property_parent ( ) const

The parent widget of this widget. Must be a Container widget.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_receives_default() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_receives_default ( )

If TRUE, the widget will receive the default action when it is focused.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_receives_default() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_receives_default ( ) const

If TRUE, the widget will receive the default action when it is focused.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_sensitive() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_sensitive ( )

Whether the widget responds to input.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_sensitive() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_sensitive ( ) const

Whether the widget responds to input.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_style() [1/2]

Glib::PropertyProxy< Glib::RefPtr<Style> > Gtk::Widget::property_style ( )

The style of the widget, which contains information about how it will look (colors etc).

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_style() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Style> > Gtk::Widget::property_style ( ) const

The style of the widget, which contains information about how it will look (colors etc).

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_tooltip_markup() [1/2]

Glib::PropertyProxy< Glib::ustring > Gtk::Widget::property_tooltip_markup ( )

The contents of the tooltip for this widget.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_tooltip_markup() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::Widget::property_tooltip_markup ( ) const

The contents of the tooltip for this widget.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_tooltip_text() [1/2]

Glib::PropertyProxy< Glib::ustring > Gtk::Widget::property_tooltip_text ( )

The contents of the tooltip for this widget.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_tooltip_text() [2/2]

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::Widget::property_tooltip_text ( ) const

The contents of the tooltip for this widget.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_visible() [1/2]

Glib::PropertyProxy< bool > Gtk::Widget::property_visible ( )

Whether the widget is visible.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_visible() [2/2]

Glib::PropertyProxy_ReadOnly< bool > Gtk::Widget::property_visible ( ) const

Whether the widget is visible.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_width_request() [1/2]

Glib::PropertyProxy< int > Gtk::Widget::property_width_request ( )

Override for width request of the widget, or -1 if natural request should be used.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.

◆ property_width_request() [2/2]

Glib::PropertyProxy_ReadOnly< int > Gtk::Widget::property_width_request ( ) const

Override for width request of the widget, or -1 if natural request should be used.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ property_window()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Window> > Gtk::Widget::property_window ( ) const

The widget's window if it is realized.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ push_colormap()

static void Gtk::Widget::push_colormap ( const Glib::RefPtr< const Gdk::Colormap > &  cmap)
static

Pushes cmap onto a global stack of colormaps; the topmost colormap on the stack will be used to create all widgets. Remove cmap with pop_colormap(). There's little reason to use this function.

Parameters
cmapA Gdk::Colormap.

◆ push_composite_child()

static void Gtk::Widget::push_composite_child ( )
static

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

A composite child is a child that's an implementation detail of the container it's inside and should not be visible to people using the container. Composite children aren't treated differently by GTK (but see Gtk::Container::foreach() vs. Gtk::Container::forall()), but e.g. GUI builders might want to treat them in a different way.

Here is a simple example:

[C example ellipted]

◆ queue_draw()

void Gtk::Widget::queue_draw ( )

Equivalent to calling queue_draw_area() for the entire area of a widget.

◆ queue_draw_area()

void Gtk::Widget::queue_draw_area ( int  x,
int  y,
int  width,
int  height 
)

Invalidates the rectangular area of widget defined by x, y, width and height by calling gdk_window_invalidate_rect() on the widget's window and all its child windows. Once the main loop becomes idle (after the current batch of events has been processed, roughly), the window will receive expose events for the union of all regions that have been invalidated.

Normally you would only use this function in widget implementations. You might also use it, or gdk_window_invalidate_rect() directly, to schedule a redraw of a Gtk::DrawingArea or some portion thereof.

Frequently you can just call gdk_window_invalidate_rect() or gdk_window_invalidate_region() instead of this function. Those functions will invalidate only a single window, instead of the widget and all its children.

The advantage of adding to the invalidated region compared to simply drawing immediately is efficiency; using an invalid region ensures that you only have to redraw one time.

Parameters
xX coordinate of upper-left corner of rectangle to redraw.
yY coordinate of upper-left corner of rectangle to redraw.
widthWidth of region to draw.
heightHeight of region to draw.

◆ queue_resize()

void Gtk::Widget::queue_resize ( )

This function is only for use in widget implementations. Flags a widget to have its size renegotiated; should be called when a widget for some reason has a new size request. For example, when you change the text in a Gtk::Label, Gtk::Label queues a resize to ensure there's enough space for the new text.

◆ queue_resize_no_redraw()

void Gtk::Widget::queue_resize_no_redraw ( )

This function works like queue_resize(), except that the widget is not invalidated.

◆ rc_style()

bool Gtk::Widget::rc_style ( ) const

◆ realize()

void Gtk::Widget::realize ( )
protected

Creates the GDK (windowing system) resources associated with a widget. For example, widget->window will be created when a widget is realized. Normally realization happens implicitly; if you show a widget and all its parent containers, then the widget will be realized and mapped automatically.

Realizing a widget requires all the widget's parent widgets to be realized; calling realize() realizes the widget's parents in addition to widget itself. If a widget is not yet inside a toplevel window when you realize it, bad things will happen.

This function is primarily used in widget implementations, and isn't very useful otherwise. Many times when you think you might need it, a better approach is to connect to a signal that will be called after the widget is realized automatically, such as GtkWidget::expose-event. Or simply Glib::signal_connect() to the GtkWidget::realize signal.

◆ realize_if_needed()

void Gtk::Widget::realize_if_needed ( )
protected

◆ receives_default()

bool Gtk::Widget::receives_default ( ) const

◆ region_intersect()

Gdk::Region Gtk::Widget::region_intersect ( const Gdk::Region region) const

Computes the intersection of a widget's area and region, returning the intersection. The result may be empty, use gdk_region_empty() to check.

Parameters
regionA Gdk::Region, in the same coordinate system as widget->allocation. That is, relative to widget->window for NO_WINDOW widgets; relative to the parent window of widget->window for widgets with their own window.
Returns
A newly allocated region holding the intersection of widget and region. The coordinates of the return value are relative to widget->window for NO_WINDOW widgets, and relative to the parent window of widget->window for widgets with their own window.

◆ remove_accelerator()

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

Parameters
accel_groupAccel group for this widget.
accel_keyGDK keyval of the accelerator.
accel_modsModifier key combination of the accelerator.
Returns
Whether an accelerator was installed and could be removed.

◆ remove_mnemonic_label()

void Gtk::Widget::remove_mnemonic_label ( Widget label)

Removes a widget from the list of mnemonic labels for this widget. (See list_mnemonic_labels()). The widget must have previously been added to the list with add_mnemonic_label().

Parameters
labelA Gtk::Widget that was previously set as a mnemnic label for widget with add_mnemonic_label().

◆ remove_modal_grab()

void Gtk::Widget::remove_modal_grab ( )

Remove the modal grab of the widget in case it was previously grabbed.

◆ render_icon()

Glib::RefPtr<Gdk::Pixbuf> Gtk::Widget::render_icon ( const StockID stock_id,
IconSize  size,
const Glib::ustring &  detail = Glib::ustring() 
)

A convenience function that uses the theme engine and RC file settings for the widget to look up stock_id and render it to a pixbuf. stock_id should be a stock icon ID such as Gtk::STOCK_OPEN or Gtk::STOCK_OK. size should be a size such as Gtk::ICON_SIZE_MENU. detail should be a string that identifies the widget or code doing the rendering, so that theme engines can special-case rendering for that widget or code.

The pixels in the returned Gdk::Pixbuf are shared with the rest of the application and should not be modified. The pixbuf should be freed after use with Glib::object_unref().

Parameters
stock_idA stock ID.
sizeA stock size. A size of (GtkIconSize)-1 means render at the size of the source and don't scale (if there are multiple source sizes, GTK+ picks one of the available sizes).
detailRender detail to pass to theme engine.
Returns
A new pixbuf if the stock ID was known.

◆ reparent()

void Gtk::Widget::reparent ( Widget new_parent)

Moves a widget from one Gtk::Container to another, handling reference count issues to avoid destroying the widget.

Parameters
new_parentA Gtk::Container to move the widget into.

◆ reset_rc_styles()

void Gtk::Widget::reset_rc_styles ( )

Reset the styles of widget and all descendents, so when they are looked up again, they get the correct values for the currently loaded RC file settings.

This function is not useful for applications.

◆ reset_shapes()

void Gtk::Widget::reset_shapes ( )

Recursively resets the shape on this widget and its descendants.

Deprecated: This function is being removed in GTK+ 3.0. Don't use it.

◆ send_expose()

int Gtk::Widget::send_expose ( GdkEvent event)

Very rarely-used function. This function is used to emit an expose event signals on a widget. This function is not normally used directly. The only time it is used is when propagating an expose event to a child NO_WINDOW widget, and that is normally done using Gtk::Container::propagate_expose().

If you want to force an area of a window to be redrawn, use gdk_window_invalidate_rect() or gdk_window_invalidate_region(). To cause the redraw to be done immediately, follow that call with a call to gdk_window_process_updates().

Parameters
eventA expose Gdk::Event.
Returns
Return from the event signal emission (true if the event was handled).

◆ send_focus_change()

bool Gtk::Widget::send_focus_change ( GdkEvent event)

Sends the focus change event to widget

This function is not meant to be used by applications. The only time it should be used is when it is necessary for a Gtk::Widget to assign focus to a widget that is semantically owned by the first widget even though it's not a direct child - for instance, a search entry in a floating window similar to the quick search in Gtk::TreeView.

An example of its usage is:

[C example ellipted]

Parameters
eventA Gdk::Event of type GDK_FOCUS_CHANGE.
Returns
The return value from the event signal emission: true if the event was handled, and false otherwise.

◆ sensitive()

bool Gtk::Widget::sensitive ( ) const

◆ set_accel_path()

void Gtk::Widget::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. This removes any accelerators (for any accelerator group) installed by previous calls to set_accel_path(). Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (See Gtk::AccelMap::save().)

This function is a low level function that would most likely be used by a menu creation system like Gtk::UIManager. If you use Gtk::UIManager, setting up accelerator paths will be done automatically.

Even when you you aren't using Gtk::UIManager, if you only want to set up accelerators on menu items Gtk::MenuItem::set_accel_path() provides a somewhat more convenient interface.

Note that accel_path string will be stored in a Quark. Therefore, if you pass a static string, you can save some memory by interning it first with Glib::intern_static_string().

Parameters
accel_pathPath used to look up the accelerator.
accel_groupA Gtk::AccelGroup.

◆ set_allocation()

void Gtk::Widget::set_allocation ( const Allocation allocation)

Sets the widget's allocation. This should not be used directly, but from within a widget's size_allocate method.

Parameters
allocationA pointer to a Gtk::Allocation to copy from.

◆ set_app_paintable()

void Gtk::Widget::set_app_paintable ( bool  app_paintable = true)

Sets whether the application intends to draw on the widget in an Gtk::Widget::signal_expose_event() handler.

This is a hint to the widget and does not affect the behavior of the GTK+ core; many widgets ignore this flag entirely. For widgets that do pay attention to the flag, such as Gtk::EventBox and Gtk::Window, the effect is to suppress default themed drawing of the widget's background. (Children of the widget will still be drawn.) The application is then entirely responsible for drawing the widget background.

Note that the background is still drawn when the widget is mapped. If this is not suitable (e.g. because you want to make a transparent window using an RGBA visual), you can work around this by doing:

[C example ellipted]

Parameters
app_paintabletrue if the application will paint on the widget.

◆ set_can_default()

void Gtk::Widget::set_can_default ( bool  can_default = true)

Specifies whether widget can be a default widget. See grab_default() for details about the meaning of "default".

Parameters
can_defaultWhether or not widget can be a default widget.

◆ set_can_focus()

void Gtk::Widget::set_can_focus ( bool  can_focus = true)

Specifies whether widget can own the input focus. See grab_focus() for actually setting the input focus on a widget.

Parameters
can_focusWhether or not widget can own the input focus.

◆ set_child_visible()

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

The child visibility can be set for widget before it is added to a container with set_parent(), to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state of true when the widget is removed from a container.

Note that changing the child visibility of a widget does not queue a resize on the widget. Most of the time, the size of a widget is computed from all visible children, whether or not they are mapped. If this is not the case, the container can queue a resize itself.

This function is only useful for container implementations and never should be called by an application.

Parameters
is_visibleIf true, widget should be mapped along with its parent.

◆ set_colormap()

void Gtk::Widget::set_colormap ( const Glib::RefPtr< const Gdk::Colormap > &  colormap)

Sets the colormap for the widget to the given value. Widget must not have been previously realized. This probably should only be used from an init() function (i.e. from the constructor for the widget).

Parameters
colormapA colormap.

◆ set_composite_name()

void Gtk::Widget::set_composite_name ( const Glib::ustring &  name)

Sets a widgets composite name. The widget must be a composite child of its parent; see push_composite_child().

Parameters
nameThe name to set.

◆ set_default_colormap()

static void Gtk::Widget::set_default_colormap ( const Glib::RefPtr< const Gdk::Colormap > &  colormap)
static

Sets the default colormap to use when creating widgets. push_colormap() is a better function to use if you only want to affect a few widgets, rather than all widgets.

Parameters
colormapA Gdk::Colormap.

◆ set_default_direction()

static void Gtk::Widget::set_default_direction ( TextDirection  dir)
static

Sets the default reading direction for widgets where the direction has not been explicitly set by set_direction().

Parameters
dirThe new default direction. This cannot be Gtk::TEXT_DIR_NONE.

◆ set_direction()

void Gtk::Widget::set_direction ( TextDirection  dir)

Sets the reading direction on a particular widget. This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction present, except for containers where the containers are arranged in an order that is explicitely visual rather than logical (such as buttons for text justification).

If the direction is set to Gtk::TEXT_DIR_NONE, then the value set by set_default_direction() will be used.

Parameters
dirThe new direction.

◆ set_double_buffered()

void Gtk::Widget::set_double_buffered ( bool  double_buffered = true)

Widgets are double buffered by default; you can use this function to turn off the buffering. "Double buffered" simply means that gdk_window_begin_paint_region() and gdk_window_end_paint() are called automatically around expose events sent to the widget. gdk_window_begin_paint() diverts all drawing to a widget's window to an offscreen buffer, and gdk_window_end_paint() draws the buffer to the screen. The result is that users see the window update in one smooth step, and don't see individual graphics primitives being rendered.

In very simple terms, double buffered widgets don't flicker, so you would only use this function to turn off double buffering if you had special needs and really knew what you were doing.

Note
if you turn off double-buffering, you have to handle expose events, since even the clearing to the background color or pixmap will not happen automatically (as it is done in gdk_window_begin_paint()).
Parameters
double_bufferedtrue to double-buffer a widget.

◆ set_events()

void Gtk::Widget::set_events ( Gdk::EventMask  events)

Sets the event mask (see Gdk::EventMask) for a widget. The event mask determines which events a widget will receive. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget's functionality, so be careful. This function must be called while a widget is unrealized. Consider add_events() for widgets that are already realized, or if you want to preserve the existing event mask. This function can't be used with Gtk::NO_WINDOW widgets; to get events on those widgets, place them inside a Gtk::EventBox and receive events on the event box.

Parameters
eventsEvent mask.

◆ set_extension_events()

void Gtk::Widget::set_extension_events ( Gdk::ExtensionMode  mode)

Sets the extension events mask to mode. See Gdk::ExtensionMode and gdk_input_set_extension_events().

Parameters
modeBitfield of extension events to receive.

◆ set_flags()

void Gtk::Widget::set_flags ( WidgetFlags  flags)

◆ set_has_tooltip()

void Gtk::Widget::set_has_tooltip ( bool  has_tooltip = TRUE)

Sets the has-tooltip property on widget to has_tooltip. See GtkWidget:has-tooltip for more information.

Parameters
has_tooltipWhether or not widget has a tooltip.

◆ set_has_window()

void Gtk::Widget::set_has_window ( bool  has_window = true)

Specifies whether widget has a Gdk::Window of its own. Note that all realized widgets have a non-0 "window" pointer (get_window() never returns a 0 window when a widget is realized), but for many of them it's actually the Gdk::Window of one of its parent widgets. Widgets that do not create a window for themselves in GtkWidget::realize() must announce this by calling this function with has_window = false.

This function should only be called by widget implementations, and they should call it in their init() function.

Parameters
has_windowWhether or not widget has a window.

◆ set_mapped()

void Gtk::Widget::set_mapped ( bool  mapped = true)
protected

Marks the widget as being realized.

This function should only ever be called in a derived widget's "map" or "unmap" implementation.

Parameters
mappedtrue to mark the widget as mapped.

◆ set_name()

void Gtk::Widget::set_name ( const Glib::ustring &  name)

Widgets can be named, which allows you to refer to them from a gtkrc file. You can apply a style to widgets with a particular name in the gtkrc file. See the documentation for gtkrc files (on the same page as the docs for Gtk::RcStyle).

Note that widget names are separated by periods in paths (see path()), so names with embedded periods may cause confusion.

Parameters
nameName for the widget.

◆ set_no_show_all()

void Gtk::Widget::set_no_show_all ( bool  no_show_all = true)

Sets the Gtk::Widget::property_no_show_all() property, which determines whether calls to show_all() and hide_all() will affect this widget.

This is mostly for use in constructing widget hierarchies with externally controlled visibility, see Gtk::UIManager.

Parameters
no_show_allThe new value for the "no-show-all" property.

◆ set_parent()

void Gtk::Widget::set_parent ( Widget parent)

This function is useful only when implementing subclasses of Gtk::Container. Sets the container as the parent of widget, and takes care of some details such as updating the state and style of the child to reflect its new location. The opposite function is unparent().

Parameters
parentParent container.

◆ set_parent_window()

void Gtk::Widget::set_parent_window ( const Glib::RefPtr< const Gdk::Window > &  parent_window)

Sets a non default parent window for widget.

Parameters
parent_windowThe new parent window.

◆ set_realized()

void Gtk::Widget::set_realized ( bool  realized = true)
protected

Marks the widget as being realized.

This function should only ever be called in a derived widget's "realize" or "unrealize" implementation.

Parameters
realizedtrue to mark the widget as realized.

◆ set_receives_default()

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

See grab_default() for details about the meaning of "default".

Parameters
receives_defaultWhether or not widget can be a default widget.

◆ set_redraw_on_allocate()

void Gtk::Widget::set_redraw_on_allocate ( bool  redraw_on_allocate = true)

Sets whether the entire widget is queued for drawing when its size allocation changes. By default, this setting is true and the entire widget is redrawn on every size change. If your widget leaves the upper left unchanged when made bigger, turning this setting off will improve performance.

Note that for NO_WINDOW widgets setting this flag to false turns off all allocation on resizing: the widget will not even redraw if its position changes; this is to allow containers that don't draw anything to avoid excess invalidations. If you set this flag on a NO_WINDOW widget that does draw on widget->window, you are responsible for invalidating both the old and new allocation of the widget when the widget is moved and responsible for invalidating regions newly when the widget increases size.

Parameters
redraw_on_allocateIf true, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.

◆ set_scroll_adjustments()

bool Gtk::Widget::set_scroll_adjustments ( Adjustment hadjustment,
Adjustment vadjustment 
)

For widgets that support scrolling, sets the scroll adjustments and returns true. For widgets that don't support scrolling, does nothing and returns false. Widgets that don't support scrolling can be scrolled by placing them in a Gtk::Viewport, which does support scrolling.

Parameters
hadjustmentAn adjustment for horizontal scrolling, or 0.
vadjustmentAn adjustment for vertical scrolling, or 0.
Returns
true if the widget supports scrolling.

◆ set_sensitive()

void Gtk::Widget::set_sensitive ( bool  sensitive = true)

Sets the sensitivity of a widget. A widget is sensitive if the user can interact with it. Insensitive widgets are "grayed out" and the user can't interact with them. Insensitive widgets are known as "inactive", "disabled", or "ghosted" in some other toolkits.

Parameters
sensitivetrue to make the widget sensitive.

◆ set_size_request()

void Gtk::Widget::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. You can use this function to force a widget to be either larger or smaller than it normally would be.

In most cases, Gtk::Window::set_default_size() is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request. When dealing with window sizes, Gtk::Window::set_geometry_hints() can be a useful function as well.

Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it's basically impossible to hardcode a size that will always be correct.

The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested.

If the size request in a given direction is -1 (unset), then the "natural" size request of the widget will be used instead.

Widgets can't actually be allocated a size less than 1 by 1, but you can pass 0,0 to this function to mean "as small as possible."

Parameters
widthWidth widget should request, or -1 to unset.
heightHeight widget should request, or -1 to unset.

◆ set_state()

void Gtk::Widget::set_state ( StateType  state)

This function is for use in widget implementations. Sets the state of a widget (insensitive, prelighted, etc.) Usually you should set the state using wrapper functions such as set_sensitive().

Parameters
stateNew state for widget.

◆ set_style()

void Gtk::Widget::set_style ( const Glib::RefPtr< Style > &  style)

Sets the Gtk::Style for a widget ( widget->style). You probably don't want to use this function; it interacts badly with themes, because themes work by replacing the Gtk::Style. Instead, use modify_style().

Parameters
styleA Gtk::Style.

◆ set_tooltip_markup()

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

This function will take care of setting GtkWidget:has-tooltip to true and of the default handler for the GtkWidget::query-tooltip signal.

See also the GtkWidget:tooltip-markup property and Gtk::Tooltip::set_markup().

Parameters
markupThe contents of the tooltip for widget.

◆ set_tooltip_text()

void Gtk::Widget::set_tooltip_text ( const Glib::ustring &  text)

Sets text as the contents of the tooltip. This function will take care of setting GtkWidget:has-tooltip to true and of the default handler for the GtkWidget::query-tooltip signal.

See also the GtkWidget:tooltip-text property and Gtk::Tooltip::set_text().

Parameters
textThe contents of the tooltip for widget.

◆ set_tooltip_window()

void Gtk::Widget::set_tooltip_window ( Window window)

Replaces the default, usually yellow, window used for displaying tooltips with custom_window. GTK+ will take care of showing and hiding custom_window at the right moment, to behave likewise as the default tooltip window. If custom_window is 0, the default tooltip window will be used.

If the custom window should have the default theming it needs to have the name "gtk-tooltip", see set_name().

Parameters
windowA Gtk::Window, or 0.

◆ set_visible()

void Gtk::Widget::set_visible ( bool  visible = true)

Sets the visibility state of widget. Note that setting this to true doesn't mean the widget is actually viewable, see get_visible().

This function simply calls show() or hide() but is nicer to use when the visibility of the widget depends on some condition.

Parameters
visibleWhether the widget should be shown or not.

◆ set_window()

void Gtk::Widget::set_window ( const Glib::RefPtr< Gdk::Window > &  window)

Sets a widget's window. This function should only be used in a widget's Gtk::Widget::on_realize() implementation. The window passed is usually either a new window created with Gdk::Window::create(), or the window of its parent widget as returned by get_parent_window().

Widgets must indicate whether they will create their own Gdk::Window by calling set_has_window(). This is usually done in the widget's constructor.

This function should only be called by custom widget implementations, and they should call it in their on_realize() function.

Parameters
windowA Gdk::Window.

◆ shape_combine_mask()

void Gtk::Widget::shape_combine_mask ( const Glib::RefPtr< const Gdk::Bitmap > &  shape_mask,
int  offset_x,
int  offset_y 
)

Sets a shape for this widget's GDK window. This allows for transparent windows etc., see gdk_window_shape_combine_mask() for more information.

Parameters
shape_maskShape to be added.
offset_xX position of shape mask with respect to window.
offset_yY position of shape mask with respect to window.

◆ show()

void Gtk::Widget::show ( )

Flags a widget to be displayed. Any widget that isn't shown will not appear on the screen. If you want to show all the widgets in a container, it's easier to call show_all() on the container, instead of individually showing the widgets.

Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen.

When a toplevel container is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel container is realized and mapped.

◆ show_all()

void Gtk::Widget::show_all ( )

Recursively shows a widget, and any child widgets (if the widget is a container).

◆ show_all_vfunc()

virtual void Gtk::Widget::show_all_vfunc ( )
protectedvirtual

◆ show_now()

void Gtk::Widget::show_now ( )

Shows a widget. If the widget is an unmapped toplevel widget (i.e. a Gtk::Window that has not yet been shown), enter the main loop and wait for the window to actually be mapped. Be careful; because the main loop is running, anything can happen during this function.

◆ signal_button_press_event()

Glib::SignalProxy1< bool,GdkEventButton* > Gtk::Widget::signal_button_press_event ( )

Event triggered by user pressing button.

Slot Prototype:
bool on_my_button_press_event(GdkEventButton* event)

◆ signal_button_release_event()

Glib::SignalProxy1< bool,GdkEventButton* > Gtk::Widget::signal_button_release_event ( )

Event triggered by user releasing button.

Slot Prototype:
bool on_my_button_release_event(GdkEventButton* event)

◆ signal_child_notify()

Glib::SignalProxy1< void,GParamSpec* > Gtk::Widget::signal_child_notify ( )

The child-notify signal is emitted for each child property that has changed on an object. The signal's detail holds the property name.

Parameters
pspecThe GParamSpec of the changed child property.
Slot Prototype:
void on_my_child_notify(GParamSpec* pspec)

◆ signal_client_event()

Glib::SignalProxy1< bool,GdkEventClient* > Gtk::Widget::signal_client_event ( )
Slot Prototype:
bool on_my_client_event(GdkEventClient* event)

◆ signal_composited_changed()

Glib::SignalProxy0< void > Gtk::Widget::signal_composited_changed ( )
Slot Prototype:
void on_my_composited_changed()

◆ signal_configure_event()

Glib::SignalProxy1< bool,GdkEventConfigure* > Gtk::Widget::signal_configure_event ( )

Event triggered by a window resizing.

Slot Prototype:
bool on_my_configure_event(GdkEventConfigure* event)

◆ signal_damage_event()

Glib::SignalProxy1< bool,GdkEventExpose* > Gtk::Widget::signal_damage_event ( )
Slot Prototype:
bool on_my_damage_event(GdkEventExpose* event)

◆ signal_delete_event()

Glib::SignalProxy1< bool,GdkEventAny* > Gtk::Widget::signal_delete_event ( )

The delete_event signal is emitted if a user requests that a toplevel window is closed. The default handler for this signal hides the window.

Parameters
eventthe event which triggered this signal.
Returns
true to stop other handlers from being invoked for the event, or false to propagate the event. further.
Slot Prototype:
bool on_my_delete_event(GdkEventAny* event)

◆ signal_direction_changed()

Glib::SignalProxy1< void,TextDirection > Gtk::Widget::signal_direction_changed ( )
Slot Prototype:
void on_my_direction_changed(TextDirection direction)

◆ signal_drag_begin()

Glib::SignalProxy1< void,const Glib::RefPtr<Gdk::DragContext>& > Gtk::Widget::signal_drag_begin ( )

The drag_begin signal is emitted on the drag source when a drag is started. A typical reason to connect to this signal is to set up a custom drag icon with drag_source_set_icon().

Parameters
contextthe drag context
Slot Prototype:
void on_my_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context)

◆ signal_drag_data_delete()

Glib::SignalProxy1< void,const Glib::RefPtr<Gdk::DragContext>& > Gtk::Widget::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. The signal handler is responsible for deleting the data that has been dropped. What "delete" means, depends on the context of the drag operation.

Parameters
contextthe drag context.
Slot Prototype:
void on_my_drag_data_delete(const Glib::RefPtr<Gdk::DragContext>& context)

◆ signal_drag_data_get()

Glib::SignalProxy4< void,const Glib::RefPtr<Gdk::DragContext>&,SelectionData&,guint,guint > Gtk::Widget::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. It is the responsibility of the signal handler to fill data with the data in the format which is indicated by info. See SelectionData::set() and SelectionData::set_text().

Parameters
contextthe drag context.
selection_datathe SelectionData to be filled with the dragged data.
infothe info that has been registered with the target in the TargetList.
timethe timestamp at which the data was requested.
Slot Prototype:
void on_my_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, SelectionData& selection_data, guint info, guint time)

◆ signal_drag_data_received()

Glib::SignalProxy6< void,const Glib::RefPtr<Gdk::DragContext>&,int,int,const SelectionData&,guint,guint > Gtk::Widget::signal_drag_data_received ( )

The drag_data_received signal is emitted on the drop site when the dragged data has been received. If the data was received in order to determine whether the drop will be accepted, the handler is expected to call drag_status() and not finish the drag. If the data was received in response to a drag_drop signal (and this is the last target to be received), the handler for this signal is expected to process the received data and then call drag_finish(), setting the success parameter depending on whether the data was processed successfully.

The handler may inspect and modify drag_context->action before calling gtk_drag_finish(), e.g. to implement Gdk::ACTION_ASK.

Parameters
drag_contextthe drag context
xwhere the drop happened
ywhere the drop happened
datathe received data
infothe info that has been registered with the target in the TargetList.
timethe timestamp at which the data was received.
Slot Prototype:
void on_my_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const SelectionData& selection_data, guint info, guint time)

◆ signal_drag_drop()

Glib::SignalProxy4< bool,const Glib::RefPtr<Gdk::DragContext>&,int,int,guint > Gtk::Widget::signal_drag_drop ( )

The drag_drop signal is emitted on the drop site when the user drops the data onto the widget. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns false and no further processing is necessary. Otherwise, the handler returns true. In this case, the handler must ensure that gtk_drag_finish() is called to let the source know that the drop is done. The call to gtk_drag_finish() can be done either directly or in a drag_data_received handler which gets triggered by calling drop_get_data() to receive the data for one or more of the supported targets.

Parameters
contextthe drag context.
xthe x coordinate of the current cursor position.
ythe y coordinate of the current cursor position.
timethe timestamp of the motion event.
Returns
whether the cursor position is in a drop zone
Slot Prototype:
bool on_my_drag_drop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time)

◆ signal_drag_end()

Glib::SignalProxy1< void,const Glib::RefPtr<Gdk::DragContext>& > Gtk::Widget::signal_drag_end ( )

The drag_end signal is emitted on the drag source when a drag is finished. A typical reason to connect to this signal is to undo things done in the drag-begin signal handler.

Parameters
contextthe drag context.
Slot Prototype:
void on_my_drag_end(const Glib::RefPtr<Gdk::DragContext>& context)

◆ signal_drag_failed()

Glib::SignalProxy2< bool,const Glib::RefPtr<Gdk::DragContext>&,DragResult > Gtk::Widget::signal_drag_failed ( )
Slot Prototype:
bool on_my_drag_failed(const Glib::RefPtr<Gdk::DragContext>& context, DragResult result)

◆ signal_drag_leave()

Glib::SignalProxy2< void,const Glib::RefPtr<Gdk::DragContext>&,guint > Gtk::Widget::signal_drag_leave ( )

The drag_leave signal is emitted on the drop site when the cursor leaves the widget. A typical reason to connect to this signal is to undo things done in the drag_motion signal handler, e.g. undo highlighting with drag_unhighlight().

Parameters
contextthe drag context.
timethe timestamp of the motion event.
Slot Prototype:
void on_my_drag_leave(const Glib::RefPtr<Gdk::DragContext>& context, guint time)

◆ signal_drag_motion()

Glib::SignalProxy4< bool,const Glib::RefPtr<Gdk::DragContext>&,int,int,guint > Gtk::Widget::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. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns false and no further processing is necessary. Otherwise, the handler returns true. In this case, the handler is responsible for providing the necessary information for displaying feedback to the user, by calling drag_status(). If the decision whether the drop will be accepted or rejected can't be made based solely on the cursor position and the type of the data, the handler may inspect the dragged data by calling drag_get_data() and defer the drag_status() call to the drag_data_received handler.

Note that there is no drag_enter signal. The drag receiver has to keep track of whether he has received any drag_motion signals since the last drag_leave and if not, treat the drag_motion signal as an "enter" signal. Upon an "enter", the handler will typically highlight the drop site with drag_highlight().

Parameters
contextthe drag context.
xthe x coordinate of the current cursor position.
ythe y coordinate of the current cursor position.
timethe timestamp of the motion event.
Returns
whether the cursor position is in a drop zone.
Slot Prototype:
bool on_my_drag_motion(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time)

◆ signal_enter_notify_event()

Glib::SignalProxy1< bool,GdkEventCrossing* > Gtk::Widget::signal_enter_notify_event ( )

Event triggered by pointer entering widget area.

Slot Prototype:
bool on_my_enter_notify_event(GdkEventCrossing* event)

◆ signal_event()

Glib::SignalProxy1< bool,GdkEvent* > Gtk::Widget::signal_event ( )
Slot Prototype:
bool on_my_event(GdkEvent* event)

◆ signal_event_after()

Glib::SignalProxy1< void,GdkEvent* > Gtk::Widget::signal_event_after ( )
Slot Prototype:
void on_my_event_after(GdkEvent* event)

◆ signal_expose_event()

Glib::SignalProxy1< bool,GdkEventExpose* > Gtk::Widget::signal_expose_event ( )

Event triggered by window requiring a refresh.

Slot Prototype:
bool on_my_expose_event(GdkEventExpose* event)

◆ signal_focus()

Glib::SignalProxy1< bool,DirectionType > Gtk::Widget::signal_focus ( )
Slot Prototype:
bool on_my_focus(DirectionType direction)

◆ signal_focus_in_event()

Glib::SignalProxy1< bool,GdkEventFocus* > Gtk::Widget::signal_focus_in_event ( )
Slot Prototype:
bool on_my_focus_in_event(GdkEventFocus* event)

◆ signal_focus_out_event()

Glib::SignalProxy1< bool,GdkEventFocus* > Gtk::Widget::signal_focus_out_event ( )
Slot Prototype:
bool on_my_focus_out_event(GdkEventFocus* event)

◆ signal_grab_broken_event()

Glib::SignalProxy1< bool,GdkEventGrabBroken* > Gtk::Widget::signal_grab_broken_event ( )
Slot Prototype:
bool on_my_grab_broken_event(GdkEventGrabBroken* event)

◆ signal_grab_focus()

Glib::SignalProxy0< void > Gtk::Widget::signal_grab_focus ( )
Slot Prototype:
void on_my_grab_focus()

◆ signal_grab_notify()

Glib::SignalProxy1< void,bool > Gtk::Widget::signal_grab_notify ( )
Slot Prototype:
void on_my_grab_notify(bool was_grabbed)

◆ signal_hide()

Glib::SignalProxy0< void > Gtk::Widget::signal_hide ( )
Slot Prototype:
void on_my_hide()

◆ signal_hierarchy_changed()

Glib::SignalProxy1< void,Widget* > Gtk::Widget::signal_hierarchy_changed ( )
Slot Prototype:
void on_my_hierarchy_changed(Widget* previous_toplevel)

◆ signal_key_press_event()

Glib::SignalProxy1< bool,GdkEventKey* > Gtk::Widget::signal_key_press_event ( )

Event triggered by a key press will widget has focus.

Slot Prototype:
bool on_my_key_press_event(GdkEventKey* event)

◆ signal_key_release_event()

Glib::SignalProxy1< bool,GdkEventKey* > Gtk::Widget::signal_key_release_event ( )

Event triggered by a key release will widget has focus.

Slot Prototype:
bool on_my_key_release_event(GdkEventKey* event)

◆ signal_leave_notify_event()

Glib::SignalProxy1< bool,GdkEventCrossing* > Gtk::Widget::signal_leave_notify_event ( )

Event triggered by pointer leaving widget area.

Slot Prototype:
bool on_my_leave_notify_event(GdkEventCrossing* event)

◆ signal_map()

Glib::SignalProxy0< void > Gtk::Widget::signal_map ( )

Emitted on mapping of a widget to the screen.

Slot Prototype:
void on_my_map()

◆ signal_map_event()

Glib::SignalProxy1< bool,GdkEventAny* > Gtk::Widget::signal_map_event ( )
Slot Prototype:
bool on_my_map_event(GdkEventAny* event)

◆ signal_mnemonic_activate()

Glib::SignalProxy1< bool,bool > Gtk::Widget::signal_mnemonic_activate ( )
Slot Prototype:
bool on_my_mnemonic_activate(bool group_cycling)

◆ signal_motion_notify_event()

Glib::SignalProxy1< bool,GdkEventMotion* > Gtk::Widget::signal_motion_notify_event ( )

Event triggered by user moving pointer.

Slot Prototype:
bool on_my_motion_notify_event(GdkEventMotion* event)

◆ signal_no_expose_event()

Glib::SignalProxy1< bool,GdkEventAny* > Gtk::Widget::signal_no_expose_event ( )
Slot Prototype:
bool on_my_no_expose_event(GdkEventAny* event)

◆ signal_parent_changed()

Glib::SignalProxy1< void,Widget* > Gtk::Widget::signal_parent_changed ( )

Informs objects that their parent changed.

Slot Prototype:
void on_my_parent_changed(Widget* previous_parent)

◆ signal_popup_menu()

Glib::SignalProxy0< bool > Gtk::Widget::signal_popup_menu ( )
Slot Prototype:
bool on_my_popup_menu()

◆ signal_property_notify_event()

Glib::SignalProxy1< bool,GdkEventProperty* > Gtk::Widget::signal_property_notify_event ( )
Slot Prototype:
bool on_my_property_notify_event(GdkEventProperty* event)

◆ signal_proximity_in_event()

Glib::SignalProxy1< bool,GdkEventProximity* > Gtk::Widget::signal_proximity_in_event ( )
Slot Prototype:
bool on_my_proximity_in_event(GdkEventProximity* event)

◆ signal_proximity_out_event()

Glib::SignalProxy1< bool,GdkEventProximity* > Gtk::Widget::signal_proximity_out_event ( )
Slot Prototype:
bool on_my_proximity_out_event(GdkEventProximity* event)

◆ signal_query_tooltip()

Glib::SignalProxy4< bool,int,int,bool,const Glib::RefPtr<Tooltip>& > Gtk::Widget::signal_query_tooltip ( )
Slot Prototype:
bool on_my_query_tooltip(int x, int y, bool keyboard_tooltip, const Glib::RefPtr<Tooltip>& tooltip)

◆ signal_realize()

Glib::SignalProxy0< void > Gtk::Widget::signal_realize ( )

Emitted on realization of a widget.

Slot Prototype:
void on_my_realize()

◆ signal_screen_changed()

Glib::SignalProxy1< void,const Glib::RefPtr<Gdk::Screen>& > Gtk::Widget::signal_screen_changed ( )
Slot Prototype:
void on_my_screen_changed(const Glib::RefPtr<Gdk::Screen>& previous_screen)

◆ signal_scroll_event()

Glib::SignalProxy1< bool,GdkEventScroll* > Gtk::Widget::signal_scroll_event ( )
Slot Prototype:
bool on_my_scroll_event(GdkEventScroll* event)

◆ signal_selection_clear_event()

Glib::SignalProxy1< bool,GdkEventSelection* > Gtk::Widget::signal_selection_clear_event ( )
Slot Prototype:
bool on_my_selection_clear_event(GdkEventSelection* event)

◆ signal_selection_get()

Glib::SignalProxy3< void,SelectionData&,guint,guint > Gtk::Widget::signal_selection_get ( )
Slot Prototype:
void on_my_selection_get(SelectionData& selection_data, guint info, guint time)

◆ signal_selection_notify_event()

Glib::SignalProxy1< bool,GdkEventSelection* > Gtk::Widget::signal_selection_notify_event ( )
Slot Prototype:
bool on_my_selection_notify_event(GdkEventSelection* event)

◆ signal_selection_received()

Glib::SignalProxy2< void,const SelectionData&,guint > Gtk::Widget::signal_selection_received ( )
Slot Prototype:
void on_my_selection_received(const SelectionData& selection_data, guint time)

◆ signal_selection_request_event()

Glib::SignalProxy1< bool,GdkEventSelection* > Gtk::Widget::signal_selection_request_event ( )
Slot Prototype:
bool on_my_selection_request_event(GdkEventSelection* event)

◆ signal_show()

Glib::SignalProxy0< void > Gtk::Widget::signal_show ( )
Slot Prototype:
void on_my_show()

◆ signal_size_allocate()

Glib::SignalProxy1< void,Allocation& > Gtk::Widget::signal_size_allocate ( )
Slot Prototype:
void on_my_size_allocate(Allocation& allocation)

◆ signal_size_request()

Glib::SignalProxy1< void,Requisition* > Gtk::Widget::signal_size_request ( )
Slot Prototype:
void on_my_size_request(Requisition* requisition)

◆ signal_state_changed()

Glib::SignalProxy1< void,Gtk::StateType > Gtk::Widget::signal_state_changed ( )
Slot Prototype:
void on_my_state_changed(Gtk::StateType previous_state)

◆ signal_style_changed()

Glib::SignalProxy1< void,const Glib::RefPtr<Gtk::Style>& > Gtk::Widget::signal_style_changed ( )

The style-set signal is emitted when a new style has been set on a widget. Note that style-modifying functions like modify_base() also cause this signal to be emitted.

Parameters
previous_stylethe previous style, or an empty RefPtr if the widget just got its initial style.
Slot Prototype:
void on_my_style_changed(const Glib::RefPtr<Gtk::Style>& previous_style)

◆ signal_unmap()

Glib::SignalProxy0< void > Gtk::Widget::signal_unmap ( )
Slot Prototype:
void on_my_unmap()

◆ signal_unmap_event()

Glib::SignalProxy1< bool,GdkEventAny* > Gtk::Widget::signal_unmap_event ( )
Slot Prototype:
bool on_my_unmap_event(GdkEventAny* event)

◆ signal_unrealize()

Glib::SignalProxy0< void > Gtk::Widget::signal_unrealize ( )
Slot Prototype:
void on_my_unrealize()

◆ signal_visibility_notify_event()

Glib::SignalProxy1< bool,GdkEventVisibility* > Gtk::Widget::signal_visibility_notify_event ( )
Slot Prototype:
bool on_my_visibility_notify_event(GdkEventVisibility* event)

◆ signal_window_state_event()

Glib::SignalProxy1< bool,GdkEventWindowState* > Gtk::Widget::signal_window_state_event ( )
Slot Prototype:
bool on_my_window_state_event(GdkEventWindowState* event)

◆ size_allocate()

void Gtk::Widget::size_allocate ( const Allocation allocation)

This function is only used by Gtk::Container subclasses, to assign a size and position to their child widgets.

Parameters
allocationPosition and size to be allocated to widget.

◆ size_request() [1/2]

Requisition Gtk::Widget::size_request ( ) const

This function is typically used when implementing a Gtk::Container subclass. Obtains the preferred size of a widget. The container uses this information to arrange its child widgets and decide what size allocations to give them with size_allocate().

You can also call this function from an application, with some caveats. Most notably, getting a size request requires the widget to be associated with a screen, because font information may be needed. Multihead-aware applications should keep this in mind.

Also remember that the size request is not necessarily the size a widget will actually be allocated.

See also get_child_requisition().

Returns
A Gtk::Requisition.

◆ size_request() [2/2]

void Gtk::Widget::size_request ( const Requisition requisition)

This function is typically used when implementing a Gtk::Container subclass. Obtains the preferred size of a widget. The container uses this information to arrange its child widgets and decide what size allocations to give them with size_allocate().

You can also call this function from an application, with some caveats. Most notably, getting a size request requires the widget to be associated with a screen, because font information may be needed. Multihead-aware applications should keep this in mind.

Also remember that the size request is not necessarily the size a widget will actually be allocated.

See also get_child_requisition().

Parameters
requisitionA Gtk::Requisition to be filled in.

◆ style_attach()

void Gtk::Widget::style_attach ( )
protected

This function attaches the widget's Gtk::Style to the widget's Gdk::Window. It is a replacement for

widget->style = gtk_style_attach (widget->style, widget->window);

and should only ever be called in a derived widget's "realize" implementation which does not chain up to its parent class' "realize" implementation, because one of the parent classes (finally Gtk::Widget) would attach the style itself.

◆ thaw_child_notify()

void Gtk::Widget::thaw_child_notify ( )

Reverts the effect of a previous call to freeze_child_notify(). This causes all queued Gtk::Widget::signal_child_notify() signals on widget to be emitted.

◆ translate_coordinates()

bool Gtk::Widget::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. In order to perform this operation, both widgets must be realized, and must share a common toplevel.

Parameters
dest_widgetA Gtk::Widget.
src_xX position relative to src_widget.
src_yY position relative to src_widget.
dest_xLocation to store X position relative to dest_widget.
dest_yLocation to store Y position relative to dest_widget.
Returns
false if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in
  • dest_x and * dest_y. Otherwise true.

◆ trigger_tooltip_query()

void Gtk::Widget::trigger_tooltip_query ( )

Triggers a tooltip query on the display where the toplevel of widget is located. See Gtk::Tooltip::trigger_tooltip_query() for more information.

◆ unmap()

void Gtk::Widget::unmap ( )

This function is only for use in widget implementations. Causes a widget to be unmapped if it's currently mapped.

◆ unparent()

void Gtk::Widget::unparent ( )

This function is only for use in widget implementations. Should be called by implementations of the remove method on Gtk::Container, to dissociate a child from the container.

◆ unrealize()

void Gtk::Widget::unrealize ( )
protected

This function is only useful in widget implementations. Causes a widget to be unrealized (frees all GDK resources associated with the widget, such as widget->window).

◆ unset_base()

void Gtk::Widget::unset_base ( StateType  state)

Undo the effect of previous calls to modify_base() for a particular state. All other style values are left untouched. See also modify_style().

◆ unset_bg()

void Gtk::Widget::unset_bg ( StateType  state)

Undo the effect of previous calls to modify_bg() for a particular state. All other style values are left untouched. See also modify_style().

◆ unset_composite_name()

void Gtk::Widget::unset_composite_name ( )

◆ unset_cursor()

void Gtk::Widget::unset_cursor ( )

◆ unset_fg()

void Gtk::Widget::unset_fg ( StateType  state)

Undo the effect of previous calls to modify_fg() for a particular state. All other style values are left untouched. See also modify_style().

◆ unset_flags()

void Gtk::Widget::unset_flags ( WidgetFlags  flags)

◆ unset_font()

void Gtk::Widget::unset_font ( )

Undo the effect of previous calls to modify_font() for a particular state. All other style values are left untouched. See also modify_style().

◆ unset_input_shape_combine_mask()

void Gtk::Widget::unset_input_shape_combine_mask ( )

◆ unset_name()

void Gtk::Widget::unset_name ( )

◆ unset_shape_combine_mask()

void Gtk::Widget::unset_shape_combine_mask ( )

◆ unset_style()

void Gtk::Widget::unset_style ( )

◆ unset_text()

void Gtk::Widget::unset_text ( StateType  state)

Undo the effect of previous calls to modify_text() for a particular state. All other style values are left untouched. See also modify_style().

Friends And Related Function Documentation

◆ Main

friend class Main
friend

Definition at line 510 of file tk/ytkmm/ytkmm/gtkmm/widget.h.

◆ wrap()

Gtk::Widget * wrap ( GtkWidget object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file: