gtk.Objectthe base class of the PyGTK type hierarchy.Synopsisgtk.Objectgobject.GObjectflagsset_flagsflagsunset_flagsflagsdestroyFunctionsgtk.bindings_activateobjectkeyvalmodifiersgtk.bindings_activate_eventobjecteventgtk.binding_entry_add_signalobjectkeyvalmodifierssignal_name...gtk.binding_entry_removeclass_typekeyvalmodifiersAncestry+-- gobject.GObject
+-- gtk.Object
gtk.Object Properties
"user-data"Read-WriteAnonymous User Data Pointer
gtk.Object Signal Prototypesgobject.GObject Signal Prototypes"destroy"callbackobjectuser_param1...Descriptiongtk.Object is the
base class for all widgets, and for a few non-widget objects such as gtk.Adjustment.
gtk.Object
predates GObject; non-widgets
that derive from gtk.Object rather
than GObject do
so for backward compatibility reasons.The "destroy" signal, emitted by the destroy()
method asks all code owning a GTK reference to the object to release its GTK
reference. So, for example, if you call
window.destroy() where
window is a gtk.Window, GTK will
release the GTK reference count that it owns; if you call
button.destroy() where button is a gtk.Button,
button will be removed from its parent container and
the parent container will release its GTK reference to
button. Because these GTK references are released,
calling destroy()
should result in freeing all memory associated with an object (finalizing
it) if the GTK reference count reaches zero. However, in PyGTK the GTK
objects are wrapped in a Python object that has its own reference counting
mechanism. The destroy()
method does not affect the Python reference counts. The GTK object
associated with a Python object will not be released until the Python object
reference count reaches zero. Therefore, calling the destroy()
method will not result in the finalization of the GTK object until the
Python object is finalized. In the case mentioned above if a gtk.Button is
destroyed using the destroy()
method, it will be removed from its container and unmapped and unrealized
but it will not be finalized because the Python wrapper object will still
exist and hold a reference.Methodsgtk.Object.flagsflagsReturns :the flags set for the
objectThe flags() method returns the value of
the flags for the object. The flags returned will include both the gtk.Object flags and
the gtk.Widget
flags.The gtk.Object flags
are:gtk.IN_DESTRUCTIONthe object is currently being destroyed.gtk.FLOATINGthe object is orphaned.gtk.RESERVED_1reserved for future usegtk.RESERVED_2reserved for future useThe gtk.Widget flags
are:gtk.TOPLEVELwidgets without a real parent (e.g. gtk.Window and gtk.Menu) have this
flag set throughout their lifetime. Toplevel widgets always contain their
own gtk.gdk.Window.gtk.NO_WINDOWa widget that does not provide its own gtk.gdk.Window.
Visible action (e.g. drawing) is performed on the parent's gtk.gdk.Window.gtk.REALIZEDthe widget has an associated gtk.gdk.Window.gtk.MAPPEDthe widget can be displayed on the screen.gtk.VISIBLEthe widget will be mapped as soon as its parent is
mapped.gtk.SENSITIVEThe sensitivity of a widget determines whether it will
receive certain events (e.g. button or key presses). One requirement for the
widget's sensitivity is to have this flag set.gtk.PARENT_SENSITIVEThis is the second requirement for the widget's
sensitivity. Once a widget has gtk.SENSITIVE and
gtk.PARENT_SENSITIVE set, its state is effectively
sensitive.gtk.CAN_FOCUSthe widget is able to handle focus grabs.gtk.HAS_FOCUSthe widget has the focus - assumes that
gtk.CAN_FOCUS is setgtk.CAN_DEFAULTthe widget is allowed to receive the default
action.gtk.HAS_DEFAULTthe widget currently will receive the default
action.gtk.HAS_GRABthe widget is in the grab_widgets stack, and will be
the preferred one for receiving events.gtk.RC_STYLEthe widgets 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.gtk.COMPOSITE_CHILDthe widget is a composite child of its
parent.gtk.NO_REPARENTunusedgtk.APP_PAINTABLEset on widgets whose window the application directly
draws on, in order to keep GTK from overwriting the drawn stuff.gtk.RECEIVES_DEFAULTthe widget when focused will receive the default action
and have gtk.HAS_DEFAULT set even if there is a different
widget set as default.gtk.DOUBLE_BUFFEREDexposes done on the widget should be
double-buffered.gtk.Object.set_flagsset_flagsflagsflags :the gtk.Object and gtk.Widget flags to
be set on this objectThe set_flags() method sets the object
flags according to the value of flags. See flags()
for a description of the gtk.Object and gtk.Widget flags
that can be set.gtk.Object.unset_flagsunset_flagsflagsflags :the gtk.Object and gtk.Widget flags to
be unset on this objectThe unset_flags() method unsets the
object flags according to the value of flags. See
flags()
for a description of the gtk.Object and gtk.Widget flags
that can be unset.gtk.Object.destroydestroyThe destroy() method emits the
"destroy" signal notifying all reference holders that they should release
the gtk.Object.Functionsgtk.bindings_activategtk.bindings_activateobjectkeyvalmodifiersobject :the gtk.Object to
activate the bindings onkeyval :a key valuemodifiers :a modifier mask :Returns :True if the binding could be
activatedThe gtk.bindings_activate() function
activates the bindings associated with the gtk.Object specified
by object with the key value specified by keyval and
the modifier mask specified by modifiers.gtk.bindings_activate_eventgtk.bindings_activate_eventobjecteventobject :the gtk.Object to
activate the bindings onevent :a gtk.gdk.EventReturns :True if a matching key
binding was foundThe gtk.bindings_activate_event() function
looks up key bindings for the gtk.Object specified
by object to find one matching the key gtk.gdk.Event
specified by event, and if one was found, activate
it.gtk.binding_entry_add_signalgtk.binding_entry_add_signalobjectkeyvalmodifierssignal_name...object :the gtk.Object
class the binding entry will be associated withkeyval :the key valuemodifiers :the modifier masksignal_name :the signal name... :zero or more pairs of value type-value
pairsThe gtk.binding_entry_add_signal() function
adds a binding (specified by keyval and
modifiers) to the binding set of the object class
derived from object. The signal specified by
signal_name will be emitted with the optional
arguments specified by the argument pairs denoted by ... that are value type
and value. This function is used when creating a new widget class to set up
key bindings.gtk.binding_entry_removegtk.binding_entry_removeclass_typekeyvalmodifiersclass_type :the gtk.Object
class the binding entry will be removed fromkeyval :the key valuemodifiers :the modifier maskThis function is available in PyGTK 2.2 and above.The gtk.binding_entry_remove() function
removes the binding (specified by keyval and
modifiers) from the binding set of the object class
specified by class_type.SignalsThe "destroy" gtk.Object Signalcallbackobjectuser_param1...object :the object that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "destroy" signal is emitted when the references for the
object should be destroyed.