Top | ![]() |
![]() |
![]() |
![]() |
DzlPropertiesGroupDzlPropertiesGroup — A GActionGroup of properties on an object |
This class is a GActionGroup which provides stateful access to properties in a GObject. This can be useful when you want to expose properties from a GObject as a GAction, espectially with use in GtkApplications.
Call dzl_properties_group_add_property()
to setup the mappings
for action-name to property-name for the actions you'd like to
add.
Not all property types can be supported. What is current supported are properties of type:
G_TYPE_INT
G_TYPE_UINT
G_TYPE_BOOLEAN
G_TYPE_STRING
G_TYPE_DOUBLE
DzlPropertiesGroup *
dzl_properties_group_new (GObject *object
);
This creates a new DzlPropertiesGroup to create stateful actions
around properties in object
.
Call dzl_properties_group_add_property()
to add a property to
action name mapping for this group. Until you've called this,
no actions are mapped.
Note that DzlPropertiesGroup only holds a weak reference to
object
and therefore you must keep object
alive elsewhere.
Since: 3.26
DzlPropertiesGroup *
dzl_properties_group_new_for_type (GType object_type
);
This creates a new DzlPropertiesGroup for which the initial object is
NULL
.
Set object_type
to a type of a class which is a GObject-based type.
void dzl_properties_group_add_property (DzlPropertiesGroup *self
,const gchar *name
,const gchar *property_name
);
Adds a new stateful action named name
which maps to the underlying
property property_name
of “object”.
Since: 3.26
void dzl_properties_group_add_property_full (DzlPropertiesGroup *self
,const gchar *name
,const gchar *property_name
,DzlPropertiesFlags flags
);
Adds a new stateful action named name
which maps to the underlying
property property_name
of “object”.
Seting flags
allows you to tweak some settings about the action.
self |
||
name |
the name of the action |
|
property_name |
the name of the property |
|
flags |
optional flags for the action |
Since: 3.26
void
dzl_properties_group_add_all_properties
(DzlPropertiesGroup *self
);
This function will try to add all properties found on the target instance to the group. Only properties that are supported by the DzlPropertiesGroup will be added.
The action name of all added properties will be identical to their property name.
Since: 3.26
void dzl_properties_group_remove (DzlPropertiesGroup *self
,const gchar *name
);
Removes an action from self
that was previously added with
dzl_properties_group_add_property()
. name
should match the
name parameter to that function.
Since: 3.26