| GTK+ Reference Manual | ||||
|---|---|---|---|---|
#include <gtk/gtk.h>
GtkWidget;
GtkWidgetClass;
enum GtkWidgetFlags;
#define GTK_WIDGET_TYPE (wid)
#define GTK_WIDGET_STATE (wid)
#define GTK_WIDGET_SAVED_STATE (wid)
#define GTK_WIDGET_FLAGS (wid)
#define GTK_WIDGET_TOPLEVEL (wid)
#define GTK_WIDGET_NO_WINDOW (wid)
#define GTK_WIDGET_REALIZED (wid)
#define GTK_WIDGET_MAPPED (wid)
#define GTK_WIDGET_VISIBLE (wid)
#define GTK_WIDGET_DRAWABLE (wid)
#define GTK_WIDGET_SENSITIVE (wid)
#define GTK_WIDGET_PARENT_SENSITIVE (wid)
#define GTK_WIDGET_IS_SENSITIVE (wid)
#define GTK_WIDGET_CAN_FOCUS (wid)
#define GTK_WIDGET_HAS_FOCUS (wid)
#define GTK_WIDGET_CAN_DEFAULT (wid)
#define GTK_WIDGET_RECEIVES_DEFAULT (wid)
#define GTK_WIDGET_HAS_DEFAULT (wid)
#define GTK_WIDGET_HAS_GRAB (wid)
#define GTK_WIDGET_RC_STYLE (wid)
#define GTK_WIDGET_COMPOSITE_CHILD (wid)
#define GTK_WIDGET_APP_PAINTABLE (wid)
#define GTK_WIDGET_DOUBLE_BUFFERED (wid)
#define GTK_WIDGET_SET_FLAGS (wid,flag)
#define GTK_WIDGET_UNSET_FLAGS (wid,flag)
void (*GtkCallback) (GtkWidget *widget,
gpointer data);
GtkRequisition;
struct GtkAllocation;
GtkSelectionData;
GtkWidgetAuxInfo;
GtkWidgetShapeInfo;
enum GtkWidgetHelpType;
GtkWidget* gtk_widget_new (GType type,
const gchar *first_property_name,
...);
GtkWidget* gtk_widget_ref (GtkWidget *widget);
void gtk_widget_unref (GtkWidget *widget);
void gtk_widget_destroy (GtkWidget *widget);
void gtk_widget_destroyed (GtkWidget *widget,
GtkWidget **widget_pointer);
void gtk_widget_set (GtkWidget *widget,
const gchar *first_property_name,
...);
void gtk_widget_unparent (GtkWidget *widget);
void gtk_widget_show (GtkWidget *widget);
void gtk_widget_show_now (GtkWidget *widget);
void gtk_widget_hide (GtkWidget *widget);
void gtk_widget_show_all (GtkWidget *widget);
void gtk_widget_hide_all (GtkWidget *widget);
void gtk_widget_map (GtkWidget *widget);
void gtk_widget_unmap (GtkWidget *widget);
void gtk_widget_realize (GtkWidget *widget);
void gtk_widget_unrealize (GtkWidget *widget);
void gtk_widget_queue_draw (GtkWidget *widget);
void gtk_widget_queue_resize (GtkWidget *widget);
void gtk_widget_queue_resize_no_redraw (GtkWidget *widget);
void gtk_widget_draw (GtkWidget *widget,
const GdkRectangle *area);
void gtk_widget_size_request (GtkWidget *widget,
GtkRequisition *requisition);
void gtk_widget_get_child_requisition (GtkWidget *widget,
GtkRequisition *requisition);
void gtk_widget_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
void gtk_widget_add_accelerator (GtkWidget *widget,
const gchar *accel_signal,
GtkAccelGroup *accel_group,
guint accel_key,
GdkModifierType accel_mods,
GtkAccelFlags accel_flags);
gboolean gtk_widget_remove_accelerator (GtkWidget *widget,
GtkAccelGroup *accel_group,
guint accel_key,
GdkModifierType accel_mods);
void gtk_widget_set_accel_path (GtkWidget *widget,
const gchar *accel_path,
GtkAccelGroup *accel_group);
GList* gtk_widget_list_accel_closures (GtkWidget *widget);
gboolean gtk_widget_can_activate_accel (GtkWidget *widget,
guint signal_id);
gboolean gtk_widget_event (GtkWidget *widget,
GdkEvent *event);
gboolean gtk_widget_activate (GtkWidget *widget);
void gtk_widget_reparent (GtkWidget *widget,
GtkWidget *new_parent);
gboolean gtk_widget_intersect (GtkWidget *widget,
const GdkRectangle *area,
GdkRectangle *intersection);
gboolean gtk_widget_is_focus (GtkWidget *widget);
void gtk_widget_grab_focus (GtkWidget *widget);
void gtk_widget_grab_default (GtkWidget *widget);
void gtk_widget_set_name (GtkWidget *widget,
const gchar *name);
const gchar* gtk_widget_get_name (GtkWidget *widget);
void gtk_widget_set_state (GtkWidget *widget,
GtkStateType state);
void gtk_widget_set_sensitive (GtkWidget *widget,
gboolean sensitive);
void gtk_widget_set_parent (GtkWidget *widget,
GtkWidget *parent);
void gtk_widget_set_parent_window (GtkWidget *widget,
GdkWindow *parent_window);
GdkWindow* gtk_widget_get_parent_window (GtkWidget *widget);
void gtk_widget_set_uposition (GtkWidget *widget,
gint x,
gint y);
void gtk_widget_set_usize (GtkWidget *widget,
gint width,
gint height);
void gtk_widget_set_events (GtkWidget *widget,
gint events);
void gtk_widget_add_events (GtkWidget *widget,
gint events);
void gtk_widget_set_extension_events (GtkWidget *widget,
GdkExtensionMode mode);
GdkExtensionMode gtk_widget_get_extension_events (GtkWidget *widget);
GtkWidget* gtk_widget_get_toplevel (GtkWidget *widget);
GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget,
GType widget_type);
GdkColormap* gtk_widget_get_colormap (GtkWidget *widget);
void gtk_widget_set_colormap (GtkWidget *widget,
GdkColormap *colormap);
GdkVisual* gtk_widget_get_visual (GtkWidget *widget);
gint gtk_widget_get_events (GtkWidget *widget);
void gtk_widget_get_pointer (GtkWidget *widget,
gint *x,
gint *y);
gboolean gtk_widget_is_ancestor (GtkWidget *widget,
GtkWidget *ancestor);
gboolean gtk_widget_translate_coordinates (GtkWidget *src_widget,
GtkWidget *dest_widget,
gint src_x,
gint src_y,
gint *dest_x,
gint *dest_y);
gboolean gtk_widget_hide_on_delete (GtkWidget *widget);
void gtk_widget_set_style (GtkWidget *widget,
GtkStyle *style);
#define gtk_widget_set_rc_style (widget)
void gtk_widget_ensure_style (GtkWidget *widget);
GtkStyle* gtk_widget_get_style (GtkWidget *widget);
#define gtk_widget_restore_default_style (widget)
void gtk_widget_reset_rc_styles (GtkWidget *widget);
void gtk_widget_push_colormap (GdkColormap *cmap);
void gtk_widget_pop_colormap (void);
void gtk_widget_set_default_colormap (GdkColormap *colormap);
GtkStyle* gtk_widget_get_default_style (void);
GdkColormap* gtk_widget_get_default_colormap (void);
GdkVisual* gtk_widget_get_default_visual (void);
void gtk_widget_set_direction (GtkWidget *widget,
GtkTextDirection dir);
enum GtkTextDirection;
GtkTextDirection gtk_widget_get_direction (GtkWidget *widget);
void gtk_widget_set_default_direction (GtkTextDirection dir);
GtkTextDirection gtk_widget_get_default_direction (void);
void gtk_widget_shape_combine_mask (GtkWidget *widget,
GdkBitmap *shape_mask,
gint offset_x,
gint offset_y);
void gtk_widget_input_shape_combine_mask (GtkWidget *widget,
GdkBitmap *shape_mask,
gint offset_x,
gint offset_y);
void gtk_widget_path (GtkWidget *widget,
guint *path_length,
gchar **path,
gchar **path_reversed);
void gtk_widget_class_path (GtkWidget *widget,
guint *path_length,
gchar **path,
gchar **path_reversed);
gchar* gtk_widget_get_composite_name (GtkWidget *widget);
void gtk_widget_modify_style (GtkWidget *widget,
GtkRcStyle *style);
GtkRcStyle* gtk_widget_get_modifier_style (GtkWidget *widget);
void gtk_widget_modify_fg (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);
void gtk_widget_modify_bg (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);
void gtk_widget_modify_text (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);
void gtk_widget_modify_base (GtkWidget *widget,
GtkStateType state,
const GdkColor *color);
void gtk_widget_modify_font (GtkWidget *widget,
PangoFontDescription *font_desc);
void gtk_widget_modify_cursor (GtkWidget *widget,
const GdkColor *primary,
const GdkColor *secondary);
PangoContext* gtk_widget_create_pango_context (GtkWidget *widget);
PangoContext* gtk_widget_get_pango_context (GtkWidget *widget);
PangoLayout* gtk_widget_create_pango_layout (GtkWidget *widget,
const gchar *text);
GdkPixbuf* gtk_widget_render_icon (GtkWidget *widget,
const gchar *stock_id,
GtkIconSize size,
const gchar *detail);
void gtk_widget_pop_composite_child (void);
void gtk_widget_push_composite_child (void);
void gtk_widget_queue_clear (GtkWidget *widget);
void gtk_widget_queue_clear_area (GtkWidget *widget,
gint x,
gint y,
gint width,
gint height);
void gtk_widget_queue_draw_area (GtkWidget *widget,
gint x,
gint y,
gint width,
gint height);
void gtk_widget_reset_shapes (GtkWidget *widget);
void gtk_widget_set_app_paintable (GtkWidget *widget,
gboolean app_paintable);
void gtk_widget_set_double_buffered (GtkWidget *widget,
gboolean double_buffered);
void gtk_widget_set_redraw_on_allocate (GtkWidget *widget,
gboolean redraw_on_allocate);
void gtk_widget_set_composite_name (GtkWidget *widget,
const gchar *name);
gboolean gtk_widget_set_scroll_adjustments (GtkWidget *widget,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
gboolean gtk_widget_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling);
void gtk_widget_class_install_style_property
(GtkWidgetClass *klass,
GParamSpec *pspec);
void gtk_widget_class_install_style_property_parser
(GtkWidgetClass *klass,
GParamSpec *pspec,
GtkRcPropertyParser parser);
GParamSpec* gtk_widget_class_find_style_property
(GtkWidgetClass *klass,
const gchar *property_name);
GParamSpec** gtk_widget_class_list_style_properties
(GtkWidgetClass *klass,
guint *n_properties);
GdkRegion* gtk_widget_region_intersect (GtkWidget *widget,
const GdkRegion *region);
gint gtk_widget_send_expose (GtkWidget *widget,
GdkEvent *event);
void gtk_widget_style_get (GtkWidget *widget,
const gchar *first_property_name,
...);
void gtk_widget_style_get_property (GtkWidget *widget,
const gchar *property_name,
GValue *value);
void gtk_widget_style_get_valist (GtkWidget *widget,
const gchar *first_property_name,
va_list var_args);
AtkObject* gtk_widget_get_accessible (GtkWidget *widget);
gboolean gtk_widget_child_focus (GtkWidget *widget,
GtkDirectionType direction);
void gtk_widget_child_notify (GtkWidget *widget,
const gchar *child_property);
void gtk_widget_freeze_child_notify (GtkWidget *widget);
gboolean gtk_widget_get_child_visible (GtkWidget *widget);
GtkWidget* gtk_widget_get_parent (GtkWidget *widget);
GtkSettings* gtk_widget_get_settings (GtkWidget *widget);
GtkClipboard* gtk_widget_get_clipboard (GtkWidget *widget,
GdkAtom selection);
GdkDisplay* gtk_widget_get_display (GtkWidget *widget);
GdkWindow* gtk_widget_get_root_window (GtkWidget *widget);
GdkScreen* gtk_widget_get_screen (GtkWidget *widget);
gboolean gtk_widget_has_screen (GtkWidget *widget);
void gtk_widget_get_size_request (GtkWidget *widget,
gint *width,
gint *height);
#define gtk_widget_pop_visual ()
#define gtk_widget_push_visual (visual)
void gtk_widget_set_child_visible (GtkWidget *widget,
gboolean is_visible);
#define gtk_widget_set_default_visual (visual)
void gtk_widget_set_size_request (GtkWidget *widget,
gint width,
gint height);
#define gtk_widget_set_visual (widget,visual)
void gtk_widget_thaw_child_notify (GtkWidget *widget);
void gtk_widget_set_no_show_all (GtkWidget *widget,
gboolean no_show_all);
gboolean gtk_widget_get_no_show_all (GtkWidget *widget);
GList* gtk_widget_list_mnemonic_labels (GtkWidget *widget);
void gtk_widget_add_mnemonic_label (GtkWidget *widget,
GtkWidget *label);
void gtk_widget_remove_mnemonic_label (GtkWidget *widget,
GtkWidget *label);
GtkAction* gtk_widget_get_action (GtkWidget *widget);
gboolean gtk_widget_is_composited (GtkWidget *widget);
void gtk_widget_error_bell (GtkWidget *widget);
gboolean gtk_widget_keynav_failed (GtkWidget *widget,
GtkDirectionType direction);
gchar* gtk_widget_get_tooltip_markup (GtkWidget *widget);
void gtk_widget_set_tooltip_markup (GtkWidget *widget,
const gchar *markup);
gchar* gtk_widget_get_tooltip_text (GtkWidget *widget);
void gtk_widget_set_tooltip_text (GtkWidget *widget,
const gchar *text);
GtkWindow* gtk_widget_get_tooltip_window (GtkWidget *widget);
void gtk_widget_set_tooltip_window (GtkWidget *widget,
GtkWindow *custom_window);
gboolean gtk_widget_get_has_tooltip (GtkWidget *widget);
void gtk_widget_set_has_tooltip (GtkWidget *widget,
gboolean has_tooltip);
void gtk_widget_trigger_tooltip_query (GtkWidget *widget);
GtkRequisition* gtk_requisition_copy (const GtkRequisition *requisition);
void gtk_requisition_free (GtkRequisition *requisition);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkMisc +----GtkCalendar +----GtkCellView +----GtkDrawingArea +----GtkEntry +----GtkRuler +----GtkRange +----GtkSeparator +----GtkInvisible +----GtkOldEditable +----GtkPreview +----GtkProgress
"app-paintable" gboolean : Read / Write "can-default" gboolean : Read / Write "can-focus" gboolean : Read / Write "composite-child" gboolean : Read "events" GdkEventMask : Read / Write "extension-events" GdkExtensionMode : Read / Write "has-default" gboolean : Read / Write "has-focus" gboolean : Read / Write "has-tooltip" gboolean : Read / Write "height-request" gint : Read / Write "is-focus" gboolean : Read / Write "name" gchararray : Read / Write "no-show-all" gboolean : Read / Write "parent" GtkContainer : Read / Write "receives-default" gboolean : Read / Write "sensitive" gboolean : Read / Write "style" GtkStyle : Read / Write "tooltip-markup" gchararray : Read / Write "tooltip-text" gchararray : Read / Write "visible" gboolean : Read / Write "width-request" gint : Read / Write
"cursor-aspect-ratio" gfloat : Read "cursor-color" GdkColor : Read "draw-border" GtkBorder : Read "focus-line-pattern" gchararray : Read "focus-line-width" gint : Read "focus-padding" gint : Read "interior-focus" gboolean : Read "link-color" GdkColor : Read "scroll-arrow-hlength" gint : Read "scroll-arrow-vlength" gint : Read "secondary-cursor-color" GdkColor : Read "separator-height" gint : Read "separator-width" gint : Read "visited-link-color" GdkColor : Read "wide-separators" gboolean : Read
"accel-closures-changed" "button-press-event" : Run Last "button-release-event" : Run Last "can-activate-accel" : Run Last "child-notify" : Run First / No Recursion / Has Details / No Hooks "client-event" : Run Last "composited-changed" : Run Last / Action "configure-event" : Run Last "delete-event" : Run Last "destroy-event" : Run Last "direction-changed" : Run First "drag-begin" : Run Last "drag-data-delete" : Run Last "drag-data-get" : Run Last "drag-data-received" : Run Last "drag-drop" : Run Last "drag-end" : Run Last "drag-failed" : Run Last "drag-leave" : Run Last "drag-motion" : Run Last "enter-notify-event" : Run Last "event" : Run Last "event-after" "expose-event" : Run Last "focus" : Run Last "focus-in-event" : Run Last "focus-out-event" : Run Last "grab-broken-event" : Run Last "grab-focus" : Run Last / Action "grab-notify" : Run First "hide" : Run First "hierarchy-changed" : Run Last "key-press-event" : Run Last "key-release-event" : Run Last "keynav-failed" : Run Last "leave-notify-event" : Run Last "map" : Run First "map-event" : Run Last "mnemonic-activate" : Run Last "motion-notify-event" : Run Last "move-focus" : Run Last / Action "no-expose-event" : Run Last "parent-set" : Run First "popup-menu" : Run Last / Action "property-notify-event" : Run Last "proximity-in-event" : Run Last "proximity-out-event" : Run Last "query-tooltip" : Run Last "realize" : Run First "screen-changed" : Run Last "scroll-event" : Run Last "selection-clear-event" : Run Last "selection-get" : Run Last "selection-notify-event" : Run Last "selection-received" : Run Last "selection-request-event" : Run Last "show" : Run First "show-help" : Run Last / Action "size-allocate" : Run First "size-request" : Run First "state-changed" : Run First "style-set" : Run First "unmap" : Run First "unmap-event" : Run Last "unrealize" : Run Last "visibility-notify-event" : Run Last "window-state-event" : Run Last
GtkWidget introduces style properties - these are basically object properties that are stored not on the object, but in the style object associated to the widget. Style properties are set in resource files. This mechanism is used for configuring such things as the location of the scrollbar arrows through the theme, giving theme authors more control over the look of applications without the need to write a theme engine in C.
Use gtk_widget_class_install_style_property() to install style properties for
a widget class, gtk_widget_class_find_style_property() or
gtk_widget_class_list_style_properties() to get information about existing
style properties and gtk_widget_style_get_property(), gtk_widget_style_get() or
gtk_widget_style_get_valist() to obtain the value of a style property.
The GtkWidget implementation of the GtkBuildable interface supports a custom <accelerator> element, which has attributes named key, modifiers and signal and allows to specify accelerators.
Example 47. A UI definition fragment specifying an accelerator
<object class="GtkButton"> <accelerator key="q" modifiers="GDK_CONTROL_MASK" signal="clicked"/> </object>
Example 48. A UI definition fragment specifying an accessible
<object class="GtkButton" id="label1"/>
<property name="label">I am a Label for a Button</property>
</object>
<object class="GtkButton" id="button1">
<accessibility>
<action action_name="click" description="Click the button."/>
<relation target="label1" type="labelled-by"/>
</accessibility>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-button1">
<property name="AtkObject::name">Clickable Button</property>
</object>
</child>
</object>
typedef struct {
/* The style for the widget. The style contains the
* colors the widget should be drawn in for each state
* along with graphics contexts used to draw with and
* the font to use for text.
*/
GtkStyle *style;
/* The widget's desired size.
*/
GtkRequisition requisition;
/* The widget's allocated size.
*/
GtkAllocation allocation;
/* The widget's window or its parent window if it does
* not have a window. (Which will be indicated by the
* GTK_NO_WINDOW flag being set).
*/
GdkWindow *window;
/* The widget's parent.
*/
GtkWidget *parent;
} GtkWidget;
GtkStyle * |
The style for the widget. The style contains the colors the widget should be drawn in for each state along with graphics contexts used to draw with and the font to use for text. |
GtkRequisition |
The widget's desired size. |
GtkAllocation |
The widget's allocated size. |
GdkWindow * |
The widget's window or its parent window if it does not have a window. (Which will be indicated by the GTK_NO_WINDOW flag being set). |
GtkWidget * |
typedef struct {
/* The object class structure needs to be the first
* element in the widget class structure in order for
* the class mechanism to work correctly. This allows a
* GtkWidgetClass pointer to be cast to a GtkObjectClass
* pointer.
*/
GtkObjectClass parent_class;
guint activate_signal;
guint set_scroll_adjustments_signal;
} GtkWidgetClass;
activate_signal
The signal to emit when a widget of this class is activated,
gtk_widget_activate() handles the emission. Implementation of this
signal is optional.
set_scroll_adjustment_signal
This signal is emitted when a widget of this class is added
to a scrolling aware parent, gtk_widget_set_scroll_adjustments()
handles the emission.
Implementation of this signal is optional.
typedef enum
{
GTK_TOPLEVEL = 1 << 4,
GTK_NO_WINDOW = 1 << 5,
GTK_REALIZED = 1 << 6,
GTK_MAPPED = 1 << 7,
GTK_VISIBLE = 1 << 8,
GTK_SENSITIVE = 1 << 9,
GTK_PARENT_SENSITIVE = 1 << 10,
GTK_CAN_FOCUS = 1 << 11,
GTK_HAS_FOCUS = 1 << 12,
/* widget is allowed to receive the default via gtk_widget_grab_default
* and will reserve space to draw the default if possible
*/
GTK_CAN_DEFAULT = 1 << 13,
/* the widget currently is receiving the default action and should be drawn
* appropriately if possible
*/
GTK_HAS_DEFAULT = 1 << 14,
GTK_HAS_GRAB = 1 << 15,
GTK_RC_STYLE = 1 << 16,
GTK_COMPOSITE_CHILD = 1 << 17,
GTK_NO_REPARENT = 1 << 18,
GTK_APP_PAINTABLE = 1 << 19,
/* the widget when focused will receive the default action and have
* HAS_DEFAULT set even if there is a different widget set as default
*/
GTK_RECEIVES_DEFAULT = 1 << 20,
GTK_DOUBLE_BUFFERED = 1 << 21,
GTK_NO_SHOW_ALL = 1 << 22
} GtkWidgetFlags;
Tells about certain properties of the widget.
| widgets without a real parent, as there are GtkWindows and GtkMenus have this flag set throughout their lifetime. Toplevel widgets always contain their own GdkWindow. | |
| Indicative for a widget that does not provide its own GdkWindow. Visible action (e.g. drawing) is performed on the parent's GdkWindow. | |
Set by gtk_widget_realize(), unset by gtk_widget_unrealize().
A realized widget has an associated GdkWindow.
|
|
Set by gtk_widget_map(), unset by gtk_widget_unmap().
Only realized widgets can be mapped. It means that gdk_window_show()
has been called on the widgets window(s).
|
|
Set by gtk_widget_show(), unset by gtk_widget_hide(). Implies that a
widget will be mapped as soon as its parent is mapped.
|
|
Set and unset by gtk_widget_set_sensitive().
The sensitivity of a widget determines whether it will receive
certain events (e.g. button or key presses). One premise for
the widget's sensitivity is to have this flag set.
|
|
Set and unset by gtk_widget_set_sensitive() operations on the
parents of the widget.
This is the second premise for the widget's sensitivity. Once
it has GTK_SENSITIVE and GTK_PARENT_SENSITIVE set, its state is
effectively sensitive. This is expressed (and can be examined) by
the GTK_WIDGET_IS_SENSITIVE macro.
|
|
| Determines whether a widget is able to handle focus grabs. | |
Set by gtk_widget_grab_focus() for widgets that also
have GTK_CAN_FOCUS set. The flag will be unset once another widget
grabs the focus.
|
|
The widget is allowed to receive the default action via
gtk_widget_grab_default().
|
|
| The widget currently is receiving the default action. | |
Set by gtk_grab_add(), unset by gtk_grab_remove(). It means that the
widget is in the grab_widgets stack, and will be the preferred one for
receiving events other than ones of cosmetic value.
|
|
| Indicates that the widget's style has been looked up through the rc mechanism. It does not imply that the widget actually had a style defined through the rc mechanism. | |
Indicates that the widget is a composite child of its parent; see
gtk_widget_push_composite_child(), gtk_widget_pop_composite_child().
|
|
| Unused since before GTK+ 1.2, will be removed in a future version. | |
Set and unset by gtk_widget_set_app_paintable().
Must be set on widgets whose window the application directly draws on,
in order to keep GTK+ from overwriting the drawn stuff.
|
|
The widget when focused will receive the default action and have
GTK_HAS_DEFAULT set even if there is a different widget set as default.
|
|
Set and unset by gtk_widget_set_double_buffered().
Indicates that exposes done on the widget should be double-buffered.
|
|
#define GTK_WIDGET_TYPE(wid) (GTK_OBJECT_TYPE (wid))
Gets the type of a widget.
|
a GtkWidget. |
#define GTK_WIDGET_STATE(wid) (GTK_WIDGET (wid)->state)
Returns the current state of the widget, as a GtkStateType.
|
a GtkWidget. |
#define GTK_WIDGET_SAVED_STATE(wid) (GTK_WIDGET (wid)->saved_state)
Returns the saved state of the widget, as a GtkStateType.
The saved state will be restored when a widget gets sensitive
again, after it has been made insensitive with gtk_widget_set_state()
or gtk_widget_set_sensitive().
|
a GtkWidget. |
#define GTK_WIDGET_FLAGS(wid) (GTK_OBJECT_FLAGS (wid))
Returns the widget flags from wid.
|
a GtkWidget. |
#define GTK_WIDGET_TOPLEVEL(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_TOPLEVEL) != 0)
Evaluates to TRUE if the widget is a toplevel widget.
|
a GtkWidget. |
#define GTK_WIDGET_NO_WINDOW(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_NO_WINDOW) != 0)
Evaluates to TRUE if the widget doesn't have an own GdkWindow.
|
a GtkWidget. |
#define GTK_WIDGET_REALIZED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_REALIZED) != 0)
Evaluates to TRUE if the widget is realized.
|
a GtkWidget. |
#define GTK_WIDGET_MAPPED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_MAPPED) != 0)
Evaluates to TRUE if the widget is mapped.
|
a GtkWidget. |
#define GTK_WIDGET_VISIBLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0)
Evaluates to TRUE if the widget is visible.
|
a GtkWidget. |
#define GTK_WIDGET_DRAWABLE(wid) (GTK_WIDGET_VISIBLE (wid) && GTK_WIDGET_MAPPED (wid))
Evaluates to TRUE if the widget is mapped and visible.
|
a GtkWidget. |
#define GTK_WIDGET_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_SENSITIVE) != 0)
Evaluates to TRUE if the GTK_SENSITIVE flag has be set on the widget.
|
a GtkWidget. |
#define GTK_WIDGET_PARENT_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_PARENT_SENSITIVE) != 0)
Evaluates to TRUE if the GTK_PARENT_SENSITIVE flag has be set on the widget.
|
a GtkWidget. |
#define GTK_WIDGET_IS_SENSITIVE(wid)
Evaluates to TRUE if the widget is effectively sensitive.
|
a GtkWidget. |
#define GTK_WIDGET_CAN_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_FOCUS) != 0)
Evaluates to TRUE if the widget is able to handle focus grabs.
|
a GtkWidget. |
#define GTK_WIDGET_HAS_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_FOCUS) != 0)
Evaluates to TRUE if the widget has grabbed the focus and no other
widget has done so more recently.
|
a GtkWidget. |
#define GTK_WIDGET_CAN_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_DEFAULT) != 0)
Evaluates to TRUE if the widget is allowed to receive the default action
via gtk_widget_grab_default().
|
a GtkWidget. |
#define GTK_WIDGET_RECEIVES_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RECEIVES_DEFAULT) != 0)
Evaluates to TRUE if the widget when focused will receive the default action
even if there is a different widget set as default.
|
a GtkWidget. |
#define GTK_WIDGET_HAS_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_DEFAULT) != 0)
Evaluates to TRUE if the widget currently is receiving the default action.
|
a GtkWidget. |
#define GTK_WIDGET_HAS_GRAB(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_GRAB) != 0)
Evaluates to TRUE if the widget is in the grab_widgets stack, and will be
the preferred one for receiving events other than ones of cosmetic value.
|
a GtkWidget. |
#define GTK_WIDGET_RC_STYLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RC_STYLE) != 0)
Evaluates to TRUE if the widget's style has been looked up through the rc
mechanism.
|
a GtkWidget. |
#define GTK_WIDGET_COMPOSITE_CHILD(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_COMPOSITE_CHILD) != 0)
Evaluates to TRUE if the widget is a composite child of its parent.
|
a GtkWidget. |
#define GTK_WIDGET_APP_PAINTABLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_APP_PAINTABLE) != 0)
Evaluates to TRUE if the GTK_APP_PAINTABLE flag has been set on the widget.
|
a GtkWidget. |
#define GTK_WIDGET_DOUBLE_BUFFERED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_DOUBLE_BUFFERED) != 0)
Evaluates to TRUE if the GTK_DOUBLE_BUFFERED flag has been set on the widget.
|
a GtkWidget. |
#define GTK_WIDGET_SET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) |= (flag)); }G_STMT_END
Turns on certain widget flags.
|
a GtkWidget. |
|
the flags to set. |
#define GTK_WIDGET_UNSET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) &= ~(flag)); }G_STMT_END
Turns off certain widget flags.
|
a GtkWidget. |
|
the flags to unset. |
void (*GtkCallback) (GtkWidget *widget, gpointer data);
The type of the callback functions used for e.g. iterating over
the children of a container, see gtk_container_foreach().
|
the widget to operate on |
|
user-supplied data |
typedef struct {
gint width;
gint height;
} GtkRequisition;
A GtkRequisition represents the desired size of a widget. See the section called “Size Requisition” for more information.
struct GtkAllocation {
gint x;
gint y;
gint width;
gint height;
};
A GtkAllocation of a widget represents region which has been allocated to the widget by its parent. It is a subregion of its parents allocation. See the section called “Size Allocation” for more information.
typedef struct {
GdkAtom selection;
GdkAtom target;
GdkAtom type;
gint format;
guchar *data;
gint length;
GdkDisplay *display;
} GtkSelectionData;
typedef struct {
gint x;
gint y;
gint width;
gint height;
guint x_set : 1;
guint y_set : 1;
} GtkWidgetAuxInfo;
typedef struct {
gint16 offset_x;
gint16 offset_y;
GdkBitmap *shape_mask;
} GtkWidgetShapeInfo;
typedef enum
{
GTK_WIDGET_HELP_TOOLTIP,
GTK_WIDGET_HELP_WHATS_THIS
} GtkWidgetHelpType;
GtkWidget* gtk_widget_new (GType type, const gchar *first_property_name, ...);
This is a convenience function for creating a widget and setting
its properties in one go. For example you might write:
gtk_widget_new (GTK_TYPE_LABEL, "label", "Hello World", "xalign",
0.0, NULL) to create a left-aligned label. Equivalent to
g_object_new(), but returns a widget so you don't have to
cast the object yourself.
GtkWidget* gtk_widget_ref (GtkWidget *widget);
gtk_widget_ref has been deprecated since version 2.12 and should not be used in newly-written code. Use g_object_ref() instead.
Adds a reference to a widget. This function is exactly the same
as calling g_object_ref(), and exists mostly for historical
reasons. It can still be convenient to avoid casting a widget
to a GObject, it saves a small amount of typing.
|
a GtkWidget |
Returns : |
the widget that was referenced |