Libraries:Gtk:Gtk:Activatable
Types
T
ParentT
Constants
InterfaceInfo : Std.Object.T
Nil : T
Functions
GetType() : Gtk.GObject.Type.T
Methods
:DoSetRelatedAction(self @ T, action @ Gtk.Gtk.Action.T) : Std.Object.T
This is a utility function for T implementors.
When implementing T you must call this when handling changes of the "related-action", and you must also use this to break references in GObject->dispose().
This function adds a reference to the currently set related action for you, it also makes sure the T->update() method is called when the related Gtk.Gtk.Action.T properties change and registers to the action's proxy list.
Note
Be careful to call this before setting the local copy of the Gtk.Gtk.Action.T property, since this function uses gtk_activatable_get_action() to retrieve the previous action
:GetRelatedAction(self @ T) : Gtk.Gtk.Action.T
Gets the related Gtk.Gtk.Action.T for activatable.
activatable | a T |
Returns | the related Gtk.Gtk.Action.T if one is set. [transfer none] |
:GetUseActionAppearance(self @ T) : Std.Symbol.T
Gets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.
activatable | a T |
Returns | whether activatable uses its actions appearance. |
:SetRelatedAction(self @ T, action @ Gtk.Gtk.Action.T) : Std.Object.T
Sets the related action on the activatable object.
Note
T implementors need to handle the "related-action" property and call DoSetRelatedAction when it changes.
:SetUseActionAppearance(self @ T, use_appearance @ Std.Symbol.T) : Std.Object.T
Sets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance
Note
T implementors need to handle the "use-action-appearance" property and call SyncActionProperties to update activatable if needed.
:SyncActionProperties(self @ T, action @ Gtk.Gtk.Action.T) : Std.Object.T
This is called to update the activatable completely, this is called internally when the "related-action" property is set or unset and by the implementing class when "use-action-appearance" changes.
activatable | a T |
action | the related Gtk.Gtk.Action.T or NULL. [allow-none] |
Activatable widgets can be connected to a Gtk.Gtk.Action.T and reflects the state of its action. A T can also provide feedback through its action, as they are responsible for activating their related actions.
Implementing GtkActivatable
When extending a class that is already T; it is only necessary to implement the T->sync_action_properties() and T->update() methods and chain up to the parent implementation, however when introducing a new T class; the "related-action" and "use-action-appearance" properties need to be handled by the implementor. Handling these properties is mostly a matter of installing the action pointer and boolean flag on your instance, and calling DoSetRelatedAction and SyncActionProperties at the appropriate times.
Example 39. A class fragment implementing T