~gdesklets-desklet-team/gdesklets/develbook

« back to all changes in this revision

Viewing changes to prefs-tag-toggle.xml

  • Committer: Bjoern Koch
  • Date: 2010-05-23 23:23:27 UTC
  • Revision ID: h.humpel@gmx.de-20100523232327-9ubq6xwfoojg8skt
Updating to 0.36.2 (there is ConfigToggle new) and lots of little cleaning-up and add-ons.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<section id="prefs-tag-toggle" xmlns:xi="http://www.w3.org/2001/XInclude">
 
2
  <title>&lt;toggle&gt; <emphasis>[new in 0.36.2]</emphasis></title>
 
3
 
 
4
  <para>A toggle setting. Its representation is a toggle button widget
 
5
    with items defined by <link linkend="prefs-tag-item">&lt;item&gt;</link>
 
6
    child tags.
 
7
    </para>
 
8
 
 
9
  <screenshot>
 
10
    <mediaobject>
 
11
      <imageobject>
 
12
        <imagedata fileref="gfx/prefs-toggle" format="PNG"/>
 
13
      </imageobject>
 
14
    </mediaobject>
 
15
  </screenshot>
 
16
 
 
17
 
 
18
  <section><title>Attributes</title>
 
19
 
 
20
    <informaltable frame="topbot">
 
21
    <tgroup>
 
22
 
 
23
    <thead>
 
24
      <row>
 
25
        <entry>Name</entry>
 
26
        <entry>Type</entry>
 
27
        <entry>Default Value</entry>
 
28
        <entry>Description</entry>
 
29
      </row>
 
30
    </thead>
 
31
 
 
32
    <tbody>
 
33
      <row>
 
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>
 
39
      </row>
 
40
      <row>
 
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>
 
47
      </row>
 
48
      <row>
 
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>
 
54
      </row>
 
55
      <row>
 
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>
 
61
      </row>
 
62
      <row>
 
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>
 
68
      </row>
 
69
      <row>
 
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>
 
76
      </row>
 
77
    </tbody>
 
78
 
 
79
    </tgroup>
 
80
    </informaltable>
 
81
 
 
82
  </section>
 
83
 
 
84
 
 
85
 
 
86
  <section><title>Examples</title>
 
87
 
 
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"/>
 
94
</toggle>
 
95
    ]]></programlisting>
 
96
 
 
97
  </section>
 
98
 
 
99
</section>