1
<section id="prefs-tag-toggle" xmlns:xi="http://www.w3.org/2001/XInclude">
2
<title><toggle> <emphasis>[new in 0.36.2]</emphasis></title>
4
<para>A toggle setting. Its representation is a toggle button widget
5
with items defined by <link linkend="prefs-tag-item"><item></link>
12
<imagedata fileref="gfx/prefs-toggle" format="PNG"/>
18
<section><title>Attributes</title>
20
<informaltable frame="topbot">
27
<entry>Default Value</entry>
28
<entry>Description</entry>
34
<entry valign="top">bind</entry>
35
<entry valign="top">string</entry>
36
<entry valign="top"></entry>
37
<entry valign="top">The name of the variable or property to which the
38
configuration element is bound.</entry>
41
<entry valign="top">callback</entry>
42
<entry valign="top">function</entry>
43
<entry valign="top"></entry>
44
<entry valign="top">A callback function which is called every time
45
the value changes. The callback takes the name of the bound
46
property and the new value as arguments.</entry>
49
<entry valign="top">enabled</entry>
50
<entry valign="top">boolean</entry>
51
<entry valign="top">true</entry>
52
<entry valign="top">Whether the config item is enabled. Disabled items
53
appear greyed out.</entry>
56
<entry valign="top">help</entry>
57
<entry valign="top">string</entry>
58
<entry valign="top"></entry>
59
<entry valign="top">The tooltip text for the element in the
60
configuration dialog.</entry>
63
<entry valign="top">label</entry>
64
<entry valign="top">string</entry>
65
<entry valign="top"></entry>
66
<entry valign="top">The label text for the element in the
67
configuration dialog.</entry>
70
<entry valign="top">items</entry>
71
<entry valign="top">tuple</entry>
72
<entry valign="top"></entry>
73
<entry valign="top">The items which are children of an toggle can be accessed via this
74
variable. You will get a list of tuples in the form of
75
(label, value).</entry>
86
<section><title>Examples</title>
88
<programlisting><![CDATA[
89
<toggle id="mytoggle" label="Borders" bind="mytoggle" enabled="True" >
90
<item label="Left" value="left"/>
91
<item label="Right" value="right"/>
92
<item label="Top" value="top"/>
93
<item label="Bottom" value="bottom"/>