Package: gio

Function gio:settings-bind-with-mapping

Lambda List

gio:settings-bind-with-mapping (settings key object property flags get-mapping set-mapping)

Arguments

settings -- a g:settings object
key -- a string for the key to bind
object -- a g:object object with the property to bind
property -- a string for the name of the property to bind
flags -- a g:settings-bind-flags value for the binding
get-mapping -- a g:settings-bind-get-mapping callback function that gets called to convert values from settings to object, or nil to use the default GIO mapping
set-mapping -- a g:settings-bind-set-mapping callback function that gets called to convert values from object to settings, or nil to use the default GIO mapping

Details

Create a binding between key in the settings object and the property property of object. The binding uses the provided mapping functions to map between settings and property values.

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.

Notes

This function is available since GIO 2.82. It uses closures to implement the mapping. This is not available in ealier version of GIO.
 

See also

#2026-03-25