Callbacks¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Gladeui.ActionActivateFunc(adaptor, object, action_path)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor
) – AGladeui.WidgetAdaptor
object (
GObject.Object
) – TheGObject.Object
action_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.WidgetAdaptor
object (
GObject.Object
) – TheGObject.Object
action_path (
str
) – The action identifier in the action tree
- Returns:
- Return type:
Gtk.Widget
orNone
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.WidgetAdaptor
container (
GObject.Object
) – TheGObject.Object
containerchild (
GObject.Object
) – TheGObject.Object
child
Called to add child to container.
- Gladeui.AddChildVerifyFunc(adaptor, container, child, user_feedback)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor
) – AGladeui.WidgetAdaptor
container (
GObject.Object
) – AGObject.Object
containerchild (
GObject.Object
) – AGObject.Object
childuser_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
True
and 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.WidgetAdaptor
container (
GObject.Object
) – TheGObject.Object
containerobject (
GObject.Object
) – TheGObject.Object
action_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.WidgetAdaptor
container (
GObject.Object
) – TheGObject.Object
containerchild (
GObject.Object
) – TheGObject.Object
childproperty_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.WidgetAdaptor
container (
GObject.Object
) – TheGObject.Object
containerchild (
GObject.Object
) – TheGObject.Object
childproperty_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.WidgetAdaptor
container (
GObject.Object
) – TheGObject.Object
containerchild (
GObject.Object
) – TheGObject.Object
childproperty_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
True
if 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.WidgetAdaptor
n_parameters (
int
) – amount of construct parametersparameters (
GObject.Parameter
) – array of constructGObject.Parameter
args to create the new object with.
- Returns:
A newly created
GObject.Object
- Return type:
This function is called to construct a
GObject.Object
instance. (for language bindings that may need to construct a wrapper object).
- Gladeui.CreateEPropFunc(adaptor, def_, use_command)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor
) – AGladeui.WidgetAdaptor
def (
Gladeui.PropertyDef
) – TheGladeui.PropertyDef
to be editeduse_command (
bool
) – whether to use theGladeui.Command
interface to commit property changes
- Returns:
A newly created
Gladeui.EditorProperty
- Return type:
Creates a
Gladeui.EditorProperty
to edit klass
- Gladeui.CreateEditableFunc(adaptor, type)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor
) – AGladeui.WidgetAdaptor
type (
Gladeui.EditorPageType
) – TheGladeui.EditorPageType
- Returns:
A new
Gladeui.Editable
widget- 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.WidgetAdaptor
widget (
Gladeui.Widget
) – AGladeui.Widget
of 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.WidgetAdaptor
object (
GObject.Object
) – The object to destroy
This function is called to break any additional references to a
GObject.Object
instance. Note that this function is not responsible for callingGObject.Object.unref
() on object, the reference count of object belongs to it’sGladeui.Widget
wrapper.The
Gtk.Widget
adaptor will callGtk.Widget.destroy
() before chaining up in this function.If your adaptor adds any references in any way at
Gladeui.PostCreateFunc
time orGladeui.ConstructObjectFunc
time, then this function must be implemented to also remove that reference.
- Gladeui.GetChildrenFunc(adaptor, container)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor
) – AGladeui.WidgetAdaptor
container (
GObject.Object
) – TheGObject.Object
container
- Returns:
A
GLib.List
of children- Return type:
A function called to get containers children.
- Gladeui.GetInternalFunc(adaptor, object, internal_name)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor
) – AGladeui.WidgetAdaptor
object (
GObject.Object
) – TheGObject.Object
internal_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.WidgetAdaptor
object (
GObject.Object
) – TheGObject.Object
property_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.WidgetAdaptor
object (
GObject.Object
) – TheGObject.Object
reason (
Gladeui.CreateReason
) – TheGladeui.CreateReason
that 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.WidgetAdaptor
widget (
Gladeui.Widget
) – TheGladeui.Widget
node (
Gladeui.XmlNode
) – TheGladeui.XmlNode
This function is called to update widget from node.
- Gladeui.RemoveChildFunc(adaptor, container, child)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor
) – AGladeui.WidgetAdaptor
container (
GObject.Object
) – TheGObject.Object
containerchild (
GObject.Object
) – TheGObject.Object
child
Called to remove child from container.
- Gladeui.ReplaceChildFunc(adaptor, container, old_obj, new_obj)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor
) – AGladeui.WidgetAdaptor
container (
GObject.Object
) – TheGObject.Object
containerold_obj (
GObject.Object
) – The oldGObject.Object
childnew_obj (
GObject.Object
) – The newGObject.Object
child
Called to swap placeholders with project objects in containers.
- Gladeui.SetPropertyFunc(adaptor, object, property_name, value)¶
- Parameters:
adaptor (
Gladeui.WidgetAdaptor
) – AGladeui.WidgetAdaptor
object (
GObject.Object
) – TheGObject.Object
property_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.WidgetAdaptor
def (
Gladeui.PropertyDef
) – TheGladeui.PropertyDef
value (
GObject.Value
) – TheGObject.Value
to 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.WidgetAdaptor
object (
GObject.Object
) – TheGObject.Object
property_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
True
if 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.WidgetAdaptor
widget (
Gladeui.Widget
) – TheGladeui.Widget
context (
Gladeui.XmlContext
) – TheGladeui.XmlContext
node (
Gladeui.XmlNode
) – TheGladeui.XmlNode
This function is called to fill in node from widget.