Class Index Cross Index Namespace Index

Class Gtk::Widget

Abstract Widget (Base class for all widgets)
Contained in: Gtk
Derived from: Gtk::Object
Derived by: Gtk::Calendar Gtk::Container Gtk::DrawingArea Gtk::Editable Gtk::Misc Gtk::Preview Gtk::Progress Gtk::Range Gtk::Ruler Gtk::Separator

#include <gtk--/widget.h>


public function member index:

bool accelerators_locked();
bool activate();
void add_accelerator(const nstring& accel_signal, AccelGroup& accel_group, guint accel_key, guint accel_mods, GtkAccelFlags accel_flags);
void add_events(gint events);
bool app_paintable() const;
emitable signal gint button_press_event(GdkEventButton*);
emitable signal gint button_release_event(GdkEventButton*);
bool can_default() const;
bool can_focus() const;
void class_path(string& path, string& path_reversed);
emitable signal gint client_event(GdkEventClient*);
emitable signal gint configure_event(GdkEventConfigure*);
signal void debug_msg(const gchar*);
emitable signal gint delete_event(GdkEventAny*);
signal void drag_begin(GdkDragContext*);
signal void drag_data_delete(GdkDragContext*);
signal void drag_data_get(GdkDragContext*, GtkSelectionData*, guint, guint);
signal void drag_data_received(GdkDragContext*, gint, gint, GtkSelectionData*, guint, guint32);
void drag_dest_set(GtkDestDefaults flags, const GtkTargetEntry* targets, gint n_targets, GdkDragAction actions);
void drag_dest_set_proxy(Gdk_Window& proxy_window, GdkDragProtocol protocol, bool use_coordinates);
void drag_dest_unset();
signal gboolean drag_drop(GdkDragContext*, gint, gint, guint);
signal void drag_end(GdkDragContext*);
static void drag_finish(Gdk_Drag_Context& context, bool success, bool del, guint32 time);
void drag_get_data(Gdk_Drag_Context& context, Gdk_Atom target, guint32 time);
static Widget* drag_get_source_widget(GdkDragContext* context);
void drag_highlight();
signal void drag_leave(GdkDragContext*, guint);
signal gboolean drag_motion(GdkDragContext*, gint, gint, guint);
static void drag_set_default_icon(Gdk_Colormap& colormap, Gdk_Pixmap& pixmap, Gdk_Bitmap& mask, gint hot_x, gint hot_y);
static void drag_set_icon_default(Gdk_Drag_Context& context);
static void drag_set_icon_pixmap(Gdk_Drag_Context& context, Gdk_Colormap& colormap, Gdk_Pixmap& pixmap, Gdk_Bitmap& mask, gint hot_x, gint hot_y);
static void drag_set_icon_widget(Gdk_Drag_Context& context, Widget& widget, gint hot_x, gint hot_y);
void drag_source_set(GdkModifierType start_button_mask, const GtkTargetEntry* targets, gint n_targets, GdkDragAction actions);
void drag_source_set_icon(Gdk_Colormap& colormap, Gdk_Pixmap& pixmap, Gdk_Bitmap& mask);
void drag_source_unset();
void drag_unhighlight();
void draw(GdkRectangle* p0);
emitable signal void draw_default();
emitable signal void draw_focus();
void ensure_style();
emitable signal gint enter_notify_event(GdkEventCrossing*);
emitable signal gint event(GdkEvent*);
emitable signal gint expose_event(GdkEventExpose*);
emitable signal gint focus_in_event(GdkEventFocus*);
emitable signal gint focus_out_event(GdkEventFocus*);
Widget* get_ancestor(GtkType type) const;
Gdk_Colormap get_colormap() const;
nstring get_composite_name();
static Gdk_Colormap get_default_colormap();
static Style* get_default_style();
static Gdk_Visual get_default_visual();
gint get_events() const;
GdkExtensionMode get_extension_events() const;
nstring get_name() const;
Widget* get_parent() const;
Gdk_Window get_parent_window() const;
void get_pointer(gint& x, gint& y) const;
GtkStateType get_state() const;
Style* get_style() const;
Window* get_toplevel();
Gdk_Visual get_visual() const;
Gdk_Window get_window() const;
void grab_default();
emitable signal void grab_focus();
GdkDragContext* gtkmm_drag_begin(GtkTargetList* p0, GdkDragAction p1, gint p2, GdkEvent* p3);
GtkWidget* gtkobj();
const GtkWidget* gtkobj() const;
bool has_default() const;
bool has_focus() const;
bool has_grab() const;
bool has_no_window() const;
gint height() const;
emitable signal void hide();
void hide_all();
gint intersect(const Gdk_Rectangle& area, const Gdk_Rectangle& intersection) const;
static bool isA(Object* object);
bool is_ancestor(Widget& widget) const;
bool is_composite_child() const;
bool is_drawable() const;
bool is_mapped() const;
bool is_realized() const;
bool is_sensitive() const;
bool is_toplevel() const;
bool is_visible() const;
emitable signal gint key_press_event(GdkEventKey*);
emitable signal gint key_release_event(GdkEventKey*);
emitable signal gint leave_notify_event(GdkEventCrossing*);
void lock_accelerators();
emitable signal void map_();
emitable signal gint map_event(GdkEventAny*);
emitable signal gint motion_notify_event(GdkEventMotion*);
emitable signal gint no_expose_event(GdkEventAny*);
signal void parent_changed(Widget*);
bool parent_sensitive() const;
void path(string& path, string& path_reversed);
static void pop_colormap();
static void pop_composite_child();
static void pop_style();
static void pop_visual();
void popup(gint x, gint y);
emitable signal gint property_notify_event(GdkEventProperty*);
emitable signal gint proximity_in_event(GdkEventProximity*);
emitable signal gint proximity_out_event(GdkEventProximity*);
static void push_colormap(const Gdk_Colormap& cmap);
static void push_composite_child();
static void push_style(Style& style);
static void push_visual(const Gdk_Visual& visual);
void queue_clear();
void queue_clear_area(gint x, gint y, gint width, gint height);
void queue_draw();
void queue_draw_area(gint x, gint y, gint width, gint height);
void queue_resize();
bool rc_style() const;
emitable signal void realize();
bool recieves_default() const;
void remove_accelerator(AccelGroup& accel_group, guint accel_key, guint accel_mods);
void remove_accelerators(const nstring& accel_signal, bool visible_only);
void reparent(Widget& newparent);
void reset_rc_styles();
void restore_default_style();
emitable signal gint selection_clear_event(GdkEventSelection*);
signal void selection_get(GtkSelectionData*, guint, guint);
emitable signal gint selection_notify_event(GdkEventSelection*);
signal void selection_received(GtkSelectionData*, guint);
emitable signal gint selection_request_event(GdkEventSelection*);
bool sensitive() const;
void set_app_paintable(bool app_paintable);
void set_colormap(const Gdk_Colormap& colormap);
void set_composite_name(const nstring& name);
static void set_default_colormap(const Gdk_Colormap& colormap);
static void set_default_style(Style& style);
static void set_default_visual(const Gdk_Visual& visual);
void set_events(gint events);
void set_extension_events(GdkExtensionMode mode);
void set_flags(gint flag);
void set_name(const nstring& name);
void set_parent_window(const Gdk_Window& parent_window);
void set_rc_style();
void set_sensitive(bool sensitive);
void set_state(GtkStateType state);
void set_style(Style& style);
void set_uposition(gint x, gint y);
void set_usize(gint x, gint y);
void set_visual(const Gdk_Visual& visual);
void shape_combine_mask(const Gdk_Bitmap& shape_mask, gint offset_x, gint offset_y);
emitable signal void show();
void show_all();
void show_now();
emitable signal void size_allocate(GtkAllocation*);
emitable signal void size_request(GtkRequisition*);
signal void state_changed(GtkStateType);
signal void style_changed(Style*);
void unlock_accelerators();
emitable signal void unmap_();
emitable signal gint unmap_event(GdkEventAny*);
void unparent();
void unset_flags(gint flag);
emitable signal gint visibility_notify_event(GdkEventVisibility*);
gint width() const;
virtual ~Widget();
 

protected function member index:

Widget();
virtual gint button_press_event_impl(GdkEventButton* p0);
virtual gint button_release_event_impl(GdkEventButton* p0);
virtual gint client_event_impl(GdkEventClient* p0);
virtual gint configure_event_impl(GdkEventConfigure* p0);
virtual void debug_msg_impl(const gchar* p0);
virtual gint delete_event_impl(GdkEventAny* p0);
virtual void drag_begin_impl(GdkDragContext* p0);
virtual void drag_data_delete_impl(GdkDragContext* p0);
virtual void drag_data_get_impl(GdkDragContext* p0, GtkSelectionData* p1, guint p2, guint p3);
virtual void drag_data_received_impl(GdkDragContext* p0, gint p1, gint p2, GtkSelectionData* p3, guint p4, guint32 p5);
virtual gboolean drag_drop_impl(GdkDragContext* p0, gint p1, gint p2, guint p3);
virtual void drag_end_impl(GdkDragContext* p0);
virtual void drag_leave_impl(GdkDragContext* p0, guint p1);
virtual gboolean drag_motion_impl(GdkDragContext* p0, gint p1, gint p2, guint p3);
virtual void draw_default_impl();
virtual void draw_focus_impl();
virtual void draw_impl(GdkRectangle* p0);
virtual gint enter_notify_event_impl(GdkEventCrossing* p0);
virtual gint event_impl(GdkEvent* p0);
virtual gint expose_event_impl(GdkEventExpose* p0);
virtual gint focus_in_event_impl(GdkEventFocus* p0);
virtual gint focus_out_event_impl(GdkEventFocus* p0);
virtual void grab_focus_impl();
virtual void hide_all_impl();
virtual void hide_impl();
virtual gint key_press_event_impl(GdkEventKey* p0);
virtual gint key_release_event_impl(GdkEventKey* p0);
virtual gint leave_notify_event_impl(GdkEventCrossing* p0);
virtual void map__impl();
virtual gint map_event_impl(GdkEventAny* p0);
virtual gint motion_notify_event_impl(GdkEventMotion* p0);
virtual gint no_expose_event_impl(GdkEventAny* p0);
virtual void parent_changed_impl(Widget* p0);
virtual gint property_notify_event_impl(GdkEventProperty* p0);
virtual gint proximity_in_event_impl(GdkEventProximity* p0);
virtual gint proximity_out_event_impl(GdkEventProximity* p0);
void realize_if_needed();
virtual void realize_impl();
virtual gint selection_clear_event_impl(GdkEventSelection* p0);
virtual void selection_get_impl(GtkSelectionData* p0, guint p1, guint p2);
virtual gint selection_notify_event_impl(GdkEventSelection* p0);
virtual void selection_received_impl(GtkSelectionData* p0, guint p1);
virtual gint selection_request_event_impl(GdkEventSelection* p0);
virtual void show_all_impl();
virtual void show_impl();
virtual void size_allocate_impl(GtkAllocation* p0);
virtual void size_request_impl(GtkRequisition* p0);
virtual void state_changed_impl(GtkStateType p0);
virtual void style_changed_impl(Style* p0);
virtual void unmap__impl();
virtual gint unmap_event_impl(GdkEventAny* p0);
virtual gint visibility_notify_event_impl(GdkEventVisibility* p0);
 

private function member index:

void reset_shapes();
 

Description:

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 is the *_event signals and virtual methods that every widget has. Those are events coming directly from gdk and thus also from XLib. By overriding those virtual methods you can trap everything a widget can ever do. In order to capture events from a widget, the event mask must first be set with set_events.

Only widgets with a Gdk_Window on the server side are allowed to capture events. Widgets in the Gtk::Misc group for example lack a Gdk_Window.


Function Member Descriptions:

Gtk::Widget::accelerators_locked - (Gtk 1.1)

bool accelerators_locked();

Gtk::Widget::activate -



bool activate();

Gtk::Widget::add_accelerator - (internal) adds a key to an accelerator group for this widget

void add_accelerator(const nstring& accel_signal, AccelGroup& accel_group, guint accel_key, guint accel_mods, GtkAccelFlags accel_flags);

Gtk::Widget::add_events - Add additional events to be monitored by the widget.

void add_events(gint events);

Gtk::Widget::button_press_event - Event triggered by user pressing button.

emitable signal gint button_press_event(GdkEventButton*);
virtual gint button_press_event_impl(GdkEventButton* p0);

Gtk::Widget::button_release_event - Event triggered by user releasing button.

emitable signal gint button_release_event(GdkEventButton*);
virtual gint button_release_event_impl(GdkEventButton* p0);

Gtk::Widget::class_path - (Gtk 1.1)

void class_path(string& path, string& path_reversed);

Gtk::Widget::configure_event - Event triggered by a window resizing.

emitable signal gint configure_event(GdkEventConfigure*);
virtual gint configure_event_impl(GdkEventConfigure* p0);

Gtk::Widget::delete_event - Event triggered by window begin closed.

emitable signal gint delete_event(GdkEventAny*);
virtual gint delete_event_impl(GdkEventAny* p0);

Gtk::Widget::drag_dest_set - (Gtk 1.1)

void drag_dest_set(GtkDestDefaults flags, const GtkTargetEntry* targets, gint n_targets, GdkDragAction actions);

Gtk::Widget::drag_dest_set_proxy - (Gtk 1.1)

void drag_dest_set_proxy(Gdk_Window& proxy_window, GdkDragProtocol protocol, bool use_coordinates);

Gtk::Widget::drag_dest_unset - (Gtk 1.1)

void drag_dest_unset();

Gtk::Widget::drag_finish - (Gtk 1.1)

static void drag_finish(Gdk_Drag_Context& context, bool success, bool del, guint32 time);

Gtk::Widget::drag_get_data - (Gtk 1.1)

void drag_get_data(Gdk_Drag_Context& context, Gdk_Atom target, guint32 time);

Gtk::Widget::drag_highlight - (Gtk 1.1)

void drag_highlight();

Gtk::Widget::drag_set_default_icon - (Gtk 1.1)

static void drag_set_default_icon(Gdk_Colormap& colormap, Gdk_Pixmap& pixmap, Gdk_Bitmap& mask, gint hot_x, gint hot_y);

Gtk::Widget::drag_set_icon_default - (Gtk 1.1)

static void drag_set_icon_default(Gdk_Drag_Context& context);

Gtk::Widget::drag_set_icon_pixmap - (Gtk 1.1)

static void drag_set_icon_pixmap(Gdk_Drag_Context& context, Gdk_Colormap& colormap, Gdk_Pixmap& pixmap, Gdk_Bitmap& mask, gint hot_x, gint hot_y);

Gtk::Widget::drag_set_icon_widget - (Gtk 1.1)

static void drag_set_icon_widget(Gdk_Drag_Context& context, Widget& widget, gint hot_x, gint hot_y);

Gtk::Widget::drag_source_set - (Gtk 1.1)

void drag_source_set(GdkModifierType start_button_mask, const GtkTargetEntry* targets, gint n_targets, GdkDragAction actions);

Gtk::Widget::drag_source_set_icon - (Gtk 1.1)

void drag_source_set_icon(Gdk_Colormap& colormap, Gdk_Pixmap& pixmap, Gdk_Bitmap& mask);

Gtk::Widget::drag_source_unset - (Gtk 1.1)

void drag_source_unset();

Gtk::Widget::drag_unhighlight - (Gtk 1.1)

void drag_unhighlight();

Gtk::Widget::draw - Emitted to draw the widget.

void draw(GdkRectangle* p0);
virtual void draw_impl(GdkRectangle* p0);
This is a gtk virtual function. It can only be overriden with the impl method.


Gtk::Widget::draw_default - Emitted to draw the widget in a normal state.

emitable signal void draw_default();
virtual void draw_default_impl();

Gtk::Widget::draw_focus - Emitted to draw the widget in a focused state.

emitable signal void draw_focus();
virtual void draw_focus_impl();

Gtk::Widget::enter_notify_event - Event triggered by pointer entering widget area.

emitable signal gint enter_notify_event(GdkEventCrossing*);
virtual gint enter_notify_event_impl(GdkEventCrossing* p0);

Gtk::Widget::expose_event - Event triggered by window requiring a refresh.

emitable signal gint expose_event(GdkEventExpose*);
virtual gint expose_event_impl(GdkEventExpose* p0);
Expose events cover a rectangular area that was covered or obscured by another window. That area is now exposed and thus is needs to be redrawn.

If the application is not capable of redrawing sections it should watch the count field and only draw on the last even indicated. This is important for things such as Gtk::DrawingArea.



Gtk::Widget::get_ancestor -



Widget* get_ancestor(GtkType type) const;

Gtk::Widget::get_colormap - Return the widget's colormap.

Gdk_Colormap get_colormap() const;

Gtk::Widget::get_events - Get the widget's events (bitwise or'd together).

gint get_events() const;

Gtk::Widget::get_name - Return the name of the widget.

nstring get_name() const;

Gtk::Widget::get_parent - Return the parent of this widget.

Widget* get_parent() const;

Gtk::Widget::get_parent_window - Return the parent's Gdk_Window.

Gdk_Window get_parent_window() const;

Gtk::Widget::get_style - Get the widget's style.

Style* get_style() const;
Once a style is used it is constant and unchangeable.


Gtk::Widget::get_toplevel -



Window* get_toplevel();

Gtk::Widget::get_visual - Return the widget's visual.

Gdk_Visual get_visual() const;

Gtk::Widget::get_window - Return the Gdk_Window on which the widget is drawn.

Gdk_Window get_window() const;

Gtk::Widget::gtkobj - Returns the underlaying gtk+ object.

GtkWidget* gtkobj();

Gtk::Widget::has_no_window - Returns property {flags.nowindow}.

bool has_no_window() const;

Gtk::Widget::height - Returns height of widget.

gint height() const;

Gtk::Widget::hide - Hide a widget

emitable signal void hide();
virtual void hide_impl();

Gtk::Widget::hide_all - Hide a widget and all items inserted to it

void hide_all();
virtual void hide_all_impl();

Gtk::Widget::isA - Returns true if object is this type.

static bool isA(Object* object);

Gtk::Widget::is_drawable - Returns if the widget is ready to be drawn to.

bool is_drawable() const;

Gtk::Widget::is_mapped - Returns property {flags.mapped}.

bool is_mapped() const;

Gtk::Widget::is_realized - Returns property {flags.realized}.

bool is_realized() const;

Gtk::Widget::is_toplevel - Returns property {flags.toplevel}.

bool is_toplevel() const;

Gtk::Widget::is_visible - Returns property {flags.visible}.

bool is_visible() const;

Gtk::Widget::key_press_event - Event triggered by a key press will widget has focus.

emitable signal gint key_press_event(GdkEventKey*);
virtual gint key_press_event_impl(GdkEventKey* p0);

Gtk::Widget::key_release_event - Event triggered by a key release will widget has focus.

emitable signal gint key_release_event(GdkEventKey*);
virtual gint key_release_event_impl(GdkEventKey* p0);

Gtk::Widget::leave_notify_event - Event triggered by pointer leaving widget area.

emitable signal gint leave_notify_event(GdkEventCrossing*);
virtual gint leave_notify_event_impl(GdkEventCrossing* p0);

Gtk::Widget::map_ - Emitted on mapping of a widget to the screen.

emitable signal void map_();
virtual void map__impl();
See {flags.mapped}. This should not be called by the user.


Gtk::Widget::motion_notify_event - Event triggered by user moving pointer.

emitable signal gint motion_notify_event(GdkEventMotion*);
virtual gint motion_notify_event_impl(GdkEventMotion* p0);

Gtk::Widget::parent_changed - Informs objects that their parent changed.

signal void parent_changed(Widget*);
virtual void parent_changed_impl(Widget* p0);
The widget passed is the former parent, which may be 0 if there was no parent. (was parent_set in gtk+)


Gtk::Widget::path - (Gtk 1.1)

void path(string& path, string& path_reversed);

Gtk::Widget::pop_style - Restores the old style for the widget.

static void pop_style();

Gtk::Widget::push_style - Sets a new style for the widget, and saves the old one.

static void push_style(Style& style);

Gtk::Widget::realize - Emitted on realization of a widget.

emitable signal void realize();
virtual void realize_impl();
See {flags.realized}. This is also responsible for setting {flags.realized} when it is done. Therefore, when overriding the impl method, you should call the default realize method.


Gtk::Widget::remove_accelerator - (internal) removes a key to an accelerator group for this widget

void remove_accelerator(AccelGroup& accel_group, guint accel_key, guint accel_mods);

Gtk::Widget::remove_accelerators - (internal) removes all accelerators to this object

void remove_accelerators(const nstring& accel_signal, bool visible_only);

Gtk::Widget::reparent - Change a widgets parent.

void reparent(Widget& newparent);
Equivalent to removing widget from old parent and adding it to the new parent, except that the widget will not be temporarily unrealized if both the old parent and the new parent are realized.

Use this in place of in an application.



Gtk::Widget::sensitive - Returns property {flags.sensitive}. You might want to check

bool sensitive() const;

Gtk::Widget::set_colormap - Set colormap prior to realization.

void set_colormap(const Gdk_Colormap& colormap);

Gtk::Widget::set_events - Set the events the widget wishs to capture.

void set_events(gint events);
The available event masks that the user can select are: GDK_EXPOSURE_MASK, GDK_POINTER_MOTION_MASK, GDK_POINTER_MOTION_HINT_MASK, GDK_BUTTON_MOTION_MASK, GDK_BUTTON1_MOTION_MASK, GDK_BUTTON2_MOTION_MASK, GDK_BUTTON3_MOTION_MASK, GDK_BUTTON_PRESS_MASK, GDK_BUTTON_RELEASE_MASK, GDK_KEY_PRESS_MASK, GDK_KEY_RELEASE_MASK, GDK_ENTER_NOTIFY_MASK, GDK_LEAVE_NOTIFY_MASK, GDK_FOCUS_CHANGE_MASK, GDK_STRUCTURE_MASK, GDK_PROPERTY_CHANGE_MASK, GDK_VISIBILITY_NOTIFY_MASK, GDK_PROXIMITY_IN_MASK, GDK_PROXIMITY_OUT_MASK, GDK_SUBSTRUCTURE_MASK


Gtk::Widget::set_flags - Set a member of the flags field.

void set_flags(gint flag);

Gtk::Widget::set_name - Set the name of the widget.

void set_name(const nstring& name);
You can name your widgets, so that you can know which one you have a pointer to. I don't think that this has anything to do with a text label that is shown on the widget.


Gtk::Widget::set_sensitive - Change the widgets sensitivty.

void set_sensitive(bool sensitive);
The sensitivity of a widget is whether it will accept user input or not. Usually this also changes the widget's look, to incicate it's usability. Set true to allow user input on the widget, false to disable user input.


Gtk::Widget::set_style - Set the widget's style.

void set_style(Style& style);
The style of a widget includes font, color, and other information.


Gtk::Widget::set_usize - Set the minumum widget size.

void set_usize(gint x, gint y);
Set either x or y to -1 to keep it's old size.


Gtk::Widget::set_visual - Set visual prior to realization.

void set_visual(const Gdk_Visual& visual);

Gtk::Widget::show - Show a widget.

emitable signal void show();
virtual void show_impl();
If the widget is not already destroyed, this will make the widget visible by setting {flags.visible}.


Gtk::Widget::show_all - Show a widget and all items inserted to it.

void show_all();
virtual void show_all_impl();

Gtk::Widget::state_changed - Informs objects that their state has changed.

signal void state_changed(GtkStateType);
virtual void state_changed_impl(GtkStateType p0);
The old state is passed as the argument.


Gtk::Widget::style_changed - Informs objects that their style has been changed.

signal void style_changed(Style*);
virtual void style_changed_impl(Style* p0);
The former style is passed as the argument. (was style_set in gtk+)


Gtk::Widget::unset_flags - Clear a member of the flags field.

void unset_flags(gint flag);

Gtk::Widget::width - Returns width of widget.

gint width() const;