Gio.Settings.prototype.bind_writable

function bind_writable(key: String, object: GObject.Object, property: String, inverted: Boolean): void {
    // Gjs wrapper for g_settings_bind_writable()
}
  

Create a binding between the writability of key in the settings object and the property property of object. The property must be boolean; "sensitive" or "visible" properties of widgets are the most likely candidates.

Writable bindings are always uni-directional; changes of the writability of the setting will be propagated to the object property, not the other way.

When the inverted argument is true, the binding inverts the value as it passes from the setting to the object, i.e. property will be set to true if the key is not writable.

Note that the lifecycle of the binding is tied to the 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.

Since 2.26

key

the key to bind

object

a GObject.Object

property

the name of a boolean property to bind

inverted

whether to 'invert' the value