Method
GioSettingsbind
since: 2.26
Declaration [src]
void
g_settings_bind (
GSettings* settings,
const gchar* key,
GObject* object,
const gchar* property,
GSettingsBindFlags flags
)
Description [src]
Create a binding between the key
in the settings
object
and the property property
of object
.
The binding uses the default GIO mapping functions to map
between the settings and property values. These functions
handle booleans, numeric types and string types in a
straightforward way. Use g_settings_bind_with_mapping()
if
you need a custom mapping, or map between types that are not
supported by the default mapping functions.
Unless the flags
include G_SETTINGS_BIND_NO_SENSITIVITY
, this
function also establishes a binding between the writability of
key
and the “sensitive” property of object
(if object
has
a boolean property by that name). See g_settings_bind_writable()
for more details about writable bindings.
Note that the lifecycle of the binding is tied to object
,
and that you can have only one binding per object property.
If you bind the same property twice on the same object, the second
binding overrides the first one.
Available since: 2.26
Parameters
key
-
Type:
const gchar*
The key to bind.
The data is owned by the caller of the method. The value is a NUL terminated UTF-8 string. object
-
Type:
GObject
A
GObject
.The data is owned by the caller of the method. property
-
Type:
const gchar*
The name of the property to bind.
The data is owned by the caller of the method. The value is a NUL terminated UTF-8 string. flags
-
Type:
GSettingsBindFlags
Flags for the binding.