![]() |
![]() |
![]() |
Xfconf Reference Manual | |
---|---|---|---|---|
Xfconf-GObject BindingXfconf-GObject Binding — Functions to bind Xfconf properties to GObject properties |
void xfconf_g_property_bind (XfconfChannel *channel, const gchar *xfconf_property, GType xfconf_property_type, GObject *object, const gchar *object_property); void xfconf_g_property_unbind (XfconfChannel *channel, const gchar *xfconf_property, GObject *object, const gchar *object_property); void xfconf_g_property_unbind_all (GObject *object); void xfconf_g_property_bind_gdkcolor (XfconfChannel *channel, const gchar *xfconf_property, GObject *object, const gchar *object_property);
Often it may be useful to bind an Xfconf property to a GObject property. Settings dialogs often display the current value of an Xfconf property, and a user may edit the value to change the value in the Xfconf store. If the Xfconf property changes outside the settings dialog, the user will usually want to see the settings dialog automatically update to reflect the new value. With a single line of code, Xfconf's binding functionality can automate all this.
void xfconf_g_property_bind (XfconfChannel *channel, const gchar *xfconf_property, GType xfconf_property_type, GObject *object, const gchar *object_property);
Binds an Xfconf property to a GObject property. If the property is changed via either the GObject or Xfconf, the corresponding property will also be updated.
Note that xfconf_property_type
is required since xfconf_property
may or may not already exist in the Xfconf store. The type of
object_property
will be determined automatically. If the two
types do not match, a conversion will be attempted.
|
An XfconfChannel. |
|
A property on channel .
|
|
The type of xfconf_property .
|
|
A GObject. |
|
A valid property on object .
|
void xfconf_g_property_unbind (XfconfChannel *channel, const gchar *xfconf_property, GObject *object, const gchar *object_property);
Causes an Xfconf channel previously bound to a GObject property
(see xfconf_g_property_bind()
) to no longer be bound.
|
An XfconfChannel. |
|
A bound property on channel .
|
|
A GObject. |
|
A bound property on object .
|
void xfconf_g_property_unbind_all (GObject *object);
Unbinds all Xfconf channel bindings (see xfconf_g_property_bind()
)
to the GObject.
|
A GObject. |
void xfconf_g_property_bind_gdkcolor (XfconfChannel *channel, const gchar *xfconf_property, GObject *object, const gchar *object_property);
Binds an Xfconf property to a GObject property of type GDK_TYPE_COLOR (aka a GdkColor struct). If the property is changed via either the GObject or Xfconf, the corresponding property will also be updated.
This is a special-case binding; the GdkColor struct is not ideal as-is for binding to a property, so it is stored in the Xfconf store as four 16-bit unsigned ints (red, green, blue, alpha). Since GdkColor (currently) only supports RGB and not RGBA, the last value will always be set to 0xFFFF.
Note that xfconf_property_type
is required since xfconf_property
may or may not already exist in the Xfconf store. The type of
object_property
will be determined automatically. If the two
types do not match, a conversion will be attempted.
|
An XfconfChannel. |
|
A property on channel .
|
|
A GObject. |
|
A valid property on object .
|