GtkObject::set_flags
This method allows you to set any of the flags defined by the
GtkWidgetFlags enumerated values. These
flags share the flags space in GtkObject;
the first four bits are taken by
GtkObjectFlags, and derived objects use
the remaining bitfields. The GtkWidgetFlags
settings determine the capabilities of a widget; e.g the flag
GTK_NO_WINDOW is set on certain widgets during
their creation in the GTK source, reversing the generic widget
property of $widget->window; - such widgets
are not able to respond unilaterally to GDK events. (Use a
GtkEventBox to capture events on windowless
widgets.)
You would use set_flags()
in a situation where the widget needs capabilities it does not
have at base; setting for instance
GTK_CAN_DEFAULT on a
GtkButton you want to have keyboard grab
by default will cause that button to be drawn in such a way that
space is allowed for it to be displayed with default status.
Although all the flag bitfields are reversible in this way, it is
not always sane to alter them, given that the chief
characteristics of a widget are controlled by them. For example,
unsetting the GTK_NO_WINDOW flag on a
GtkLabel widget will prevent the label from
displaying its current text.
See also: flags() ,
unset_flags() , and a whole
host of GtkWidget methods such as
set_sensitive() and
grab_default() which
either act as wrappers for the
set_flags() function or
need to work in tandem with GtkWidgetFlags
values set in this way.