Callbacks¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Gladeui.ActionActivateFunc(adaptor, object, action_path)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorobject (
GObject.Object) – TheGObject.Objectaction_path (
str) – The action identifier in the action tree
This delegate function is used to catch actions from the core.
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorobject (
GObject.Object) – TheGObject.Objectaction_path (
str) – The action identifier in the action tree
- Returns:
- Return type:
Gtk.WidgetorNone
This delegate function is used to create dynamically customized submenus. Called only for actions that don’t have children.
- Gladeui.AddChildFunc(adaptor, container, child)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorcontainer (
GObject.Object) – TheGObject.Objectcontainerchild (
GObject.Object) – TheGObject.Objectchild
Called to add child to container.
- Gladeui.AddChildVerifyFunc(adaptor, container, child, user_feedback)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorcontainer (
GObject.Object) – AGObject.Objectcontainerchild (
GObject.Object) – AGObject.Objectchilduser_feedback (
bool) – whether a notification dialog should be presented in the case that the child cannot not be added.
- Returns:
whether child can be added to parent.
- Return type:
Checks whether child can be added to container.
If user_feedback is
Trueand child cannot be added then this shows a notification dialog to the user explaining why.
- Gladeui.CatalogInitFunc(name)¶
- Parameters:
name (
str) – The name of the catalog
Called once at glade startup time for every catalog, catalogs are initialized in order of dependencies.
- Gladeui.ChildActionActivateFunc(adaptor, container, object, action_path)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorcontainer (
GObject.Object) – TheGObject.Objectcontainerobject (
GObject.Object) – TheGObject.Objectaction_path (
str) – The action identifier in the action tree
This delegate function is used to catch packing actions from the core.
- Gladeui.ChildGetPropertyFunc(adaptor, container, child, property_name, value)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorcontainer (
GObject.Object) – TheGObject.Objectcontainerchild (
GObject.Object) – TheGObject.Objectchildproperty_name (
str) – The id of the propertyvalue (
GObject.Value) – The GValue
Called to get the packing property property_name on the child object of container into value.
- Gladeui.ChildSetPropertyFunc(adaptor, container, child, property_name, value)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorcontainer (
GObject.Object) – TheGObject.Objectcontainerchild (
GObject.Object) – TheGObject.Objectchildproperty_name (
str) – The id of the propertyvalue (
GObject.Value) – The GValue
Called to set the packing property property_name to value on the child object of container.
- Gladeui.ChildVerifyPropertyFunc(adaptor, container, child, property_name, value)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorcontainer (
GObject.Object) – TheGObject.Objectcontainerchild (
GObject.Object) – TheGObject.Objectchildproperty_name (
str) – The id of the propertyvalue (
GObject.Value) – The GValue
- Returns:
whether or not its OK to set value on object, this function will silently return
Trueif the class did not provide a verify function.- Return type:
This delegate function is always called whenever setting any properties with the exception of load time, and copy/paste time (basically the two places where we recreate a hierarchy that we already know “works”) its basically an optional backend provided boundary checker for properties.
- Gladeui.ConstructObjectFunc(adaptor, n_parameters, parameters)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorn_parameters (
int) – amount of construct parametersparameters (
GObject.Parameter) – array of constructGObject.Parameterargs to create the new object with.
- Returns:
A newly created
GObject.Object- Return type:
This function is called to construct a
GObject.Objectinstance. (for language bindings that may need to construct a wrapper object).
- Gladeui.CreateEPropFunc(adaptor, def_, use_command)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptordef (
Gladeui.PropertyDef) – TheGladeui.PropertyDefto be editeduse_command (
bool) – whether to use theGladeui.Commandinterface to commit property changes
- Returns:
A newly created
Gladeui.EditorProperty- Return type:
Creates a
Gladeui.EditorPropertyto edit klass
- Gladeui.CreateEditableFunc(adaptor, type)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptortype (
Gladeui.EditorPageType) – TheGladeui.EditorPageType
- Returns:
A new
Gladeui.Editablewidget- Return type:
This is used to allow the backend to override the way an editor page is layed out (note that editor widgets are created on demand and not at startup).
- Gladeui.DependsFunc(adaptor, widget, another)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorwidget (
Gladeui.Widget) – AGladeui.Widgetof the adaptoranother (
Gladeui.Widget) – anotherGladeui.Widget
- Returns:
whether widget depends on another being parsed first in the resulting glade file.
- Return type:
Checks whether widget depends on another to be placed earlier in the glade file.
- Gladeui.DestroyObjectFunc(adaptor, object)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorobject (
GObject.Object) – The object to destroy
This function is called to break any additional references to a
GObject.Objectinstance. Note that this function is not responsible for callingGObject.Object.unref() on object, the reference count of object belongs to it’sGladeui.Widgetwrapper.The
Gtk.Widgetadaptor will callGtk.Widget.destroy() before chaining up in this function.If your adaptor adds any references in any way at
Gladeui.PostCreateFunctime orGladeui.ConstructObjectFunctime, then this function must be implemented to also remove that reference.
- Gladeui.GetChildrenFunc(adaptor, container)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorcontainer (
GObject.Object) – TheGObject.Objectcontainer
- Returns:
A
GLib.Listof children- Return type:
A function called to get containers children.
- Gladeui.GetInternalFunc(adaptor, object, internal_name)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorobject (
GObject.Object) – TheGObject.Objectinternal_name (
str) – The string identifier of the internal object
- Returns:
The internal
GObject.Object- Return type:
Called to lookup child in composite object parent by internal_name.
- Gladeui.GetPropertyFunc(adaptor, object, property_name, value)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorobject (
GObject.Object) – TheGObject.Objectproperty_name (
str) – The property identifiervalue (
GObject.Value) – TheGObject.Value
Gets value on object for a given
Gladeui.PropertyDef
- Gladeui.PostCreateFunc(adaptor, object, reason)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorobject (
GObject.Object) – TheGObject.Objectreason (
Gladeui.CreateReason) – TheGladeui.CreateReasonthat object was created for
This function is called exactly once for any project object instance and can be for any
Gladeui.CreateReason.
- Gladeui.ReadWidgetFunc(adaptor, widget, node)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorwidget (
Gladeui.Widget) – TheGladeui.Widgetnode (
Gladeui.XmlNode) – TheGladeui.XmlNode
This function is called to update widget from node.
- Gladeui.RemoveChildFunc(adaptor, container, child)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorcontainer (
GObject.Object) – TheGObject.Objectcontainerchild (
GObject.Object) – TheGObject.Objectchild
Called to remove child from container.
- Gladeui.ReplaceChildFunc(adaptor, container, old_obj, new_obj)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorcontainer (
GObject.Object) – TheGObject.Objectcontainerold_obj (
GObject.Object) – The oldGObject.Objectchildnew_obj (
GObject.Object) – The newGObject.Objectchild
Called to swap placeholders with project objects in containers.
- Gladeui.SetPropertyFunc(adaptor, object, property_name, value)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorobject (
GObject.Object) – TheGObject.Objectproperty_name (
str) – The property identifiervalue (
GObject.Value) – TheGObject.Value
This delegate function is used to apply the property value on the runtime object.
Sets value on object for a given
Gladeui.PropertyDef
- Gladeui.StringFromValueFunc(adaptor, def_, value)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptordef (
Gladeui.PropertyDef) – TheGladeui.PropertyDefvalue (
GObject.Value) – TheGObject.Valueto convert to a string
- Returns:
A newly allocated string representation of value
- Return type:
For normal properties this is used to serialize property values, for custom properties (only when new pspecs are introduced) its needed for value comparisons in boxed pspecs and also to update the UI for undo/redo items etc.
- Gladeui.VerifyPropertyFunc(adaptor, object, property_name, value)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorobject (
GObject.Object) – TheGObject.Objectproperty_name (
str) – The property identifiervalue (
GObject.Value) – TheGObject.Value
- Returns:
whether or not its OK to set value on object, this function will silently return
Trueif the class did not provide a verify function.- Return type:
This delegate function is always called whenever setting any properties with the exception of load time, and copy/paste time (basically the two places where we recreate a hierarchy that we already know “works”) its basically an optional backend provided boundary checker for properties.
- Gladeui.WriteWidgetFunc(adaptor, widget, context, node)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor) – AGladeui.WidgetAdaptorwidget (
Gladeui.Widget) – TheGladeui.Widgetcontext (
Gladeui.XmlContext) – TheGladeui.XmlContextnode (
Gladeui.XmlNode) – TheGladeui.XmlNode
This function is called to fill in node from widget.