gobject Functionsmiscellaneous functionsSynopsisgobject.type_nametypegobject.type_from_nametype_namegobject.type_parenttypegobject.type_is_atypeparent_typegobject.type_childrentypegobject.type_interfacestypegobject.type_registerclassgobject.signal_newsignal_nametypeflagsreturn_typeparam_typesgobject.signal_list_namestypegobject.signal_list_idstypegobject.signal_lookupnametypegobject.signal_namesignal_idgobject.signal_querynametypegobject.signal_querysignal_idgobject.list_propertiestypegobject.newtype...gobject.signal_accumulator_true_handledgobject.add_emission_hooktypenamecallback...gobject.remove_emission_hooktypenamehook_idgobject._install_metaclassmetaclassDescriptionThese functions are part of the PyGTK gobject
module but are not directly associated with a specific class.
Many functions that previously were in this namespace got moved to glib namespace instead. They
are still available in gobject for backward compatibility, but
not documented here. If you miss documentation for some function, be sure to
check glib first.
Functionsgobject.type_namegobject.type_nametypetype :a GObject type, type ID or
instanceReturns :The gobject.type_name() function returns
the unique name that is assigned to the specified
type. type can be a GObject
type, type ID or instance. This function raises a TypeError exception
if type isn't a PyGTK type.gobject.type_from_namegobject.type_from_nametype_nametype_name :a string containing the name of a
typeReturns :the type ID named
type_nameThe gobject.type_from_name() function
returns the type ID of the PyGTK type with the name
specified by type_name. This function raises a
RuntimeError exception if no type matches
type_name.gobject.type_parentgobject.type_parenttypetype :a GObject type, type ID or
instanceReturns :the parent type IDThe gobject.type_parent() function returns
the direct parent type ID of the specified type.
type can be a GObject type, type ID or instance. If
type has no parent, i.e. is a fundamental type, the
RuntimeError exception is raised. gobject.type_is_agobject.type_is_atypeparent_typetype :a GObject type, type ID or
instanceparent_type :a GObject type, type ID or
instanceReturns :TRUE if
parent_type is an ancestor of
typeThe gobject.type_is_a() function returns
TRUE if the specified type is a
descendant of the type specified by parent_type. This
function also returns TRUE if
parent_type is an interface and
type conforms to it.gobject.type_childrengobject.type_childrentypetype :a GObject type, type ID or
instanceReturns :a list of the child types of
typeThe gobject.type_children() function
returns a list containing the child types of the specified
type.gobject.type_interfacesgobject.type_interfacestypetype :a GObject type, type ID or
instanceReturns :a list of the interface types supported by
typeThe gobject.type_interfaces() function
returns a list of the interface types supported by
type. type can be a GObject
type, type ID or instance. This function returns a RuntimeError exception if
type is not a valid type or has no interfaces.gobject.type_registergobject.type_registerclassclass :a Python class that is a descendant of gobject.GObjectThe gobject.type_register() function
registers the specified Python class as a PyGTK type.
class must be a descendant of gobject.GObject. The function generates a name for the new type.gobject.signal_newgobject.signal_newsignal_nametypeflagsreturn_typeparam_typessignal_name :a string containing the name of the
signaltype :the object type that the signal is associated
withflags :the signal flagsreturn_type :the return type of the signal
handlerparam_types :the parameter types passed to the signal
handlerReturns :a unique integer signal IDThe gobject.signal_new() function registers
a signal with the specified signal_name for the
specified object type. The value of
flags is a combination of:gobject.SIGNAL_RUN_FIRSTInvoke the object method handler in the first emission
stage. gobject.SIGNAL_RUN_LASTInvoke the object method handler in the third emission
stage.gobject.SIGNAL_RUN_CLEANUPInvoke the object method handler in the last emission
stage.gobject.SIGNAL_NO_RECURSESignals being emitted for an object while currently
being in emission for this very object will not be emitted recursively, but
instead cause the first emission to be restarted.gobject.SIGNAL_DETAILEDThis signal supports "::detail" appendixes to the
signal name upon handler connections and emissions.gobject.SIGNAL_ACTIONAction signals are signals that may freely be emitted
on alive objects from user code via gobject.emit()()
and friends, without the need of being embedded into extra code that
performs pre or post emission adjustments on the object. They can also be
thought of as generically callable object methods.gobject.SIGNAL_NO_HOOKS No emissions hooks are supported for this
signal.return_type is the type of the return
value from a signal handler and may be a gobject type, type ID or instance.
The param_types parameter is a list of additional
types that are passed to the signal handler. Each parameter type may be
specified as a gobject type, type ID or instance. For example, to add a
signal to the gtk.Window type called "my-signal" that calls a handler with a
gtk.Button widget and an integer value and a return value that is a
boolean, use:
gobject.signal_new("my_signal", gtk.Window, gobject.SIGNAL_RUN_LAST, gobject.TYPE_BOOLEAN, (gtk.Button, gobject.TYPE_INT))
gobject.signal_list_namesgobject.signal_list_namestypetype :a GObject type, type ID or
instanceReturns :a list of the signal names supported by
typeThe gobject.signal_list_names() function
returns a list of the names of the signals that are supported by the
specified GObject typeThe type keyword is available in PyGTK 2.6 and above.gobject.signal_list_idsgobject.signal_list_idstypetype :a GObject type, type ID or
instanceReturns :a list of the signal ids supported by
typeThis method is available in PyGTK 2.6 and above.The gobject.signal_list_ids() function
returns a list of the integer ids of the signals that are supported by the
GObject specified by typegobject.signal_lookupgobject.signal_lookupnametypename :the name of a signal for
typetype :a GObject type, type ID or
instanceReturns :the integer id of a signal supported by
type or 0.This method is available in PyGTK 2.6 and above.The gobject.signal_lookup() function
returns the id of the signal with the name specified by
name that is supported by the GObject specified
specified bytype. 0 is returned if the signal is not
found.gobject.signal_namegobject.signal_namesignal_idsignal_id :an integer signal idReturns :the name of the signal or
None.This method is available in PyGTK 2.6 and above.The gobject.signal_name() function returns
the name of the signal that has the signal id specified by
id.gobject.signal_querygobject.signal_querynametypename :the name of a signal for
typetype :a GObject type, type ID or
instanceReturns :a 6-tuple containing signal information or
NoneThis method is available in PyGTK 2.6 and above.The gobject.signal_query() function returns
a 6-tuple containing information about the signal with the name specified by
name that is supported by the GObject specified by
type. If the signal is not found
None is returned.The signal information 6-tuple contains:the integer signal idthe signal namethe GType that the signal is registered forthe signal flags (see the )the GType of the return from the signal callback
functiona tuple containing the GTypes of the parameters that are
passed to the signal callback function. Note that these may not correspond
exactly to the PyGTK signal callback parameters.gobject.signal_querygobject.signal_querysignal_idsignal_id :the integer id of a signalReturns :a 6-tuple containing signal information or
NoneThis method is available in PyGTK 2.6 and above.The gobject.signal_query() function returns
a 6-tuple containing information about the signal with the id specified by
signal_id. If the signal is not found
None is returned.The signal information 6-tuple contains:the integer signal idthe signal namethe GType that the signal is registered forthe signal flags (see the )the GType of the return from the signal callback
functiona tuple containing the GTypes of the parameters that are
passed to the signal callback function. Note that these may not correspond
exactly to the PyGTK signal callback parameters.gobject.list_propertiesgobject.list_propertiestypetype :a GObject type, type ID or
instanceReturns :a list of the properties (as GParam objects)
supported by typeThe gobject.list_properties() function
returns a list of the properties (as GParam objects) supported by
type.gobject.newgobject.newtype...type :a GObject type, type ID or
instance... :zero or more property-value
pairsReturns :a new object if the specified
typeThe gobject.new() function returns a new
object of the specified type. type must specify a
type that is a descendant of gobject.GObject. A
TypeError exception is raised if type specifies an
abstract class or a type that is not a descendant of gobject.GObject. A set
of property-value pairs may be specified to set the value of the object's
properties.gobject.signal_accumulator_true_handledgobject.signal_accumulator_true_handledThis function is available in PyGTK 2.8 and above.The signal_accumulator_true_handled()
function is only used as accumulator argument when registering
signals.gobject.add_emission_hookgobject.add_emission_hooktypenamecallback...type :a Python GObject instance or
typename :a signal namecallback :a function... :zero or more extra arguments that will be
passed to callback.Returns :the hook id, for later use with gobject.signal_remove_emission_hook().This function is available in PyGTK 2.8 and above.The add_emission_hook() function adds an
emission hook for the signal specified by name,
which will get called for any emission of that signal, independent of
the instance. This is possible only for signals which don't have the
gobject.SIGNAL_NO_HOOKS flag set.gobject.remove_emission_hookgobject.remove_emission_hooktypenamehook_idtype :a Python GObject instance or
typename :a signal namehook_id :the id of the emission hook as returned by the
gobject.add_emission_hook())
function.Returns :This function is available in PyGTK 2.8 and above.The remove_emission_hook() function deletes
an emission hook.gobject._install_metaclassgobject._install_metaclassmetaclassmetaclass :This function is available in PyGTK 2.10 and above.The _install_metaclass() function installs
the metaclass specified by metaclass.