Property and FileContent
Tuner.Property
Binds a widget to a GObject property of any named object in the same blueprint file. Useful for linking widgets to each other without any settings backend.
| Property | Type | Description |
|---|---|---|
object | Object | The object to bind to |
name | string | Property name on the object |
blp
Tuner.Group {
Tuner.Switch dark_switch {
title: _("Dark mode");
binding: Tuner.Setting {
schema-id: "org.example.app";
schema-key: "dark";
};
}
Tuner.Entry {
title: _("Mirrors the switch title");
binding: Tuner.Property {
object: dark_switch;
name: "title";
};
}
}Unlike Tuner.Setting, this binding never shows a reset button.
WARNING
Native rows are built once, so writing to another Tuner widget's property does not update its already created row. Tuner.Property is most useful with your own objects exposed from plugin code.
Tuner.FileContent
The value is the whole content of a file. The path may start with ~.
| Property | Type | Description |
|---|---|---|
path | string | Path to the file |
blp
Tuner.Entry {
title: _("Note");
binding: Tuner.FileContent {
path: "~/note.txt";
};
}See Examples for a walkthrough and for writing your own binding.