From ad6a2cf538be79b43654d4c3a95a412c218ca319 Mon Sep 17 00:00:00 2001 From: Gleb Smirnov Date: Fri, 21 Jan 2022 20:20:54 +0300 Subject: [PATCH] docs: add docs for binding flags --- docs/examples.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/examples.rst b/docs/examples.rst index 3498aa0..c2e206c 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -178,6 +178,36 @@ when the UI is first constructed. value: bind bar1.value sync-create; } +Use the ``bidirectional`` keyword to bind properties in both directions. + +.. code-block:: + + // Text of entry1 is bound to text + // of entry2 and vice versa + + Gtk.Entry entry1 { + text: bind entry2.text bidirectional; + } + + Gtk.Entry entry2 { + + } + +Use the ``inverted`` keyword to invert to bind a boolean property +to inverted value of another one. + +.. code-block:: + + // When switch1 is on, switch2 will be off + Gtk.Switch switch1 { + active: bind switch2.active sync-create inverted bidirectional; + } + + // When switch2 is on, switch1 will be off + Gtk.Switch switch2 { + + } + Signals -------