Skip to content

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.

PropertyTypeDescription
objectObjectThe object to bind to
namestringProperty 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 ~.

PropertyTypeDescription
pathstringPath 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.

Released under the GPL-3.0+ License. The content is available under CC BY-SA 4.0, unless stated otherwise.