Merge lp:~gdesklets-desklet-team/gdesklets/develbook-control-array into lp:~gdesklets-desklet-team/gdesklets/develbook

Proposed by Joe Sapp
Status: Merged
Approved by: Joe Sapp
Approved revision: 10
Merged at revision: 11
Proposed branch: lp:~gdesklets-desklet-team/gdesklets/develbook-control-array
Merge into: lp:~gdesklets-desklet-team/gdesklets/develbook
Diff against target: 206 lines (+72/-12)
5 files modified
ChangeLog (+6/-0)
ctrl-use.xml (+30/-3)
info.xml (+2/-2)
tmp.xml (+32/-5)
xibook.xml (+2/-2)
To merge this branch: bzr merge lp:~gdesklets-desklet-team/gdesklets/develbook-control-array
Reviewer Review Type Date Requested Status
Bjoern Koch Approve
gDesklets Core Team Pending
Review via email: mp+24055@code.launchpad.net

Description of the change

Added information on using Control arrays

To post a comment you must log in.
10. By Joe Sapp

Merged main branch

Revision history for this message
Bjoern Koch (h.humpel) wrote :

Looks good.

But I am just wondering if we should skip the Control IDs as we don't need them anymore:

<programlisting><![CDATA[
...
<control id="myctrl" interface="ITime" length="1"/>

<script>
 Dsp.lbl1.value = str(myctrl[0].time)
</script>
...
 ]]></programlisting>

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2010-05-24 11:36:24 +0000
+++ ChangeLog 2010-06-18 01:30:41 +0000
@@ -14,6 +14,12 @@
14 * info.xml: updated copyright information (added missing 2009)14 * info.xml: updated copyright information (added missing 2009)
15 * dsp-tag-image.xml: added "saturation" attribute15 * dsp-tag-image.xml: added "saturation" attribute
1616
172010-04-23 Joe Sapp <nixphoeni@gmail.com>
18
19 * info.xml
20 * tmp.xml
21 * xibook.xml
22 * ctrl-use.xml: Added Control array information
1723
18=== 0.36.2 Released ===24=== 0.36.2 Released ===
1925
2026
=== modified file 'ctrl-use.xml'
--- ctrl-use.xml 2008-03-17 09:59:43 +0000
+++ ctrl-use.xml 2010-06-18 01:30:41 +0000
@@ -18,7 +18,7 @@
18 ]]></programlisting>18 ]]></programlisting>
1919
20 <para>The <property>id</property> attribute specifies the ID under which you20 <para>The <property>id</property> attribute specifies the ID under which you
21 later want to access the control in your applet. Controls are no display21 later want to access the control in your applet. Controls are not display
22 elements, thus this ID will not be put into the22 elements, thus this ID will not be put into the
23 <link linkend="script-using-dsp"><literal>Dsp</literal> namespace</link>,23 <link linkend="script-using-dsp"><literal>Dsp</literal> namespace</link>,
24 but is directly accessible.</para>24 but is directly accessible.</para>
@@ -30,7 +30,7 @@
3030
31 <para>Controls are property-based. There are properties where you can read31 <para>Controls are property-based. There are properties where you can read
32 from, and properties where you can write to. You can use the32 from, and properties where you can write to. You can use the
33 <application>gdesklets-shell</application> to look up the available33 <application>gdesklets shell</application> command to look up the available
34 properties of a control and their descriptions.</para>34 properties of a control and their descriptions.</para>
3535
36 <para>By setting properties, you can e.g. change the state of a control.36 <para>By setting properties, you can e.g. change the state of a control.
@@ -64,7 +64,6 @@
64</section>64</section>
6565
6666
67
68<section id="ctrl-use-watch"><title>Watching Properties</title>67<section id="ctrl-use-watch"><title>Watching Properties</title>
6968
70 <para>The values of properties can change from time to time. For instance,69 <para>The values of properties can change from time to time. For instance,
@@ -102,4 +101,32 @@
102</section>101</section>
103102
104103
104<section id="ctrl-use-multiple"><title>Using Multiple Controls</title>
105
106 <para>Since controls can be considered state machines, sometimes it's useful
107 to support multiple instances of a control in a desklet. This can be done
108 by instantiating the control with the <property>length</property> property
109 explicitly set. With this set at load-time, the control will only be
110 accessible like a list and will be expandable with the
111 <property>length</property> property. If you do not, the control may not
112 necessarily provide the <property>length</property> property, will be
113 accessible as shown above, and will not be expandable. In other words,
114 existing desklets will continue to work as they are.</para>
115
116 <programlisting><![CDATA[
117...
118<control id="myctrl" interface="ITime:9y703dqtfnv4w373caserz68r" length="1"/>
119
120<script>
121 Dsp.lbl1.value = str(myctrl[0].time)
122</script>
123...
124 ]]></programlisting>
125
126 <para>For compatibility with this feature, you should not implement a
127 <property>length</property> property in your control.</para>
128
129</section>
130
131
105</section>132</section>
106133
=== modified file 'info.xml'
--- info.xml 2010-05-23 23:23:27 +0000
+++ info.xml 2010-06-18 01:30:41 +0000
@@ -24,7 +24,7 @@
24 </author>24 </author>
25 </authorgroup>25 </authorgroup>
2626
27 <edition>Developer's Book for gDesklets v0.36.2</edition>27 <edition>Developer's Book for gDesklets v0.36.3(beta)</edition>
28 <pubdate>2010</pubdate>28 <pubdate>2010</pubdate>
2929
30 <copyright>30 <copyright>
@@ -39,7 +39,7 @@
39 </copyright>39 </copyright>
4040
41 <releaseinfo>41 <releaseinfo>
42 This book describes version 0.36.2 of the gDesklets platform.42 This book describes version 0.36.3(beta) of the gDesklets platform.
43 </releaseinfo>43 </releaseinfo>
4444
45 <legalnotice>45 <legalnotice>
4646
=== modified file 'tmp.xml'
--- tmp.xml 2010-05-24 11:36:24 +0000
+++ tmp.xml 2010-06-18 01:30:41 +0000
@@ -29,7 +29,7 @@
29 </author>29 </author>
30 </authorgroup>30 </authorgroup>
3131
32 <edition>Developer's Book for gDesklets v0.36.2</edition>32 <edition>Developer's Book for gDesklets v0.36.3(beta)</edition>
33 <pubdate>2010</pubdate>33 <pubdate>2010</pubdate>
3434
35 <copyright>35 <copyright>
@@ -44,7 +44,7 @@
44 </copyright>44 </copyright>
4545
46 <releaseinfo>46 <releaseinfo>
47 This book describes version 0.36.2 of the gDesklets platform.47 This book describes version 0.36.3(beta) of the gDesklets platform.
48 </releaseinfo>48 </releaseinfo>
4949
50 <legalnotice>50 <legalnotice>
@@ -2867,7 +2867,7 @@
2867 ]]></programlisting>2867 ]]></programlisting>
28682868
2869 <para>The <property>id</property> attribute specifies the ID under which you2869 <para>The <property>id</property> attribute specifies the ID under which you
2870 later want to access the control in your applet. Controls are no display2870 later want to access the control in your applet. Controls are not display
2871 elements, thus this ID will not be put into the2871 elements, thus this ID will not be put into the
2872 <link linkend="script-using-dsp"><literal>Dsp</literal> namespace</link>,2872 <link linkend="script-using-dsp"><literal>Dsp</literal> namespace</link>,
2873 but is directly accessible.</para>2873 but is directly accessible.</para>
@@ -2879,7 +2879,7 @@
28792879
2880 <para>Controls are property-based. There are properties where you can read2880 <para>Controls are property-based. There are properties where you can read
2881 from, and properties where you can write to. You can use the2881 from, and properties where you can write to. You can use the
2882 <application>gdesklets-shell</application> to look up the available2882 <application>gdesklets shell</application> command to look up the available
2883 properties of a control and their descriptions.</para>2883 properties of a control and their descriptions.</para>
28842884
2885 <para>By setting properties, you can e.g. change the state of a control.2885 <para>By setting properties, you can e.g. change the state of a control.
@@ -2913,7 +2913,6 @@
2913</section>2913</section>
29142914
29152915
2916
2917<section id="ctrl-use-watch"><title>Watching Properties</title>2916<section id="ctrl-use-watch"><title>Watching Properties</title>
29182917
2919 <para>The values of properties can change from time to time. For instance,2918 <para>The values of properties can change from time to time. For instance,
@@ -2951,6 +2950,34 @@
2951</section>2950</section>
29522951
29532952
2953<section id="ctrl-use-multiple"><title>Using Multiple Controls</title>
2954
2955 <para>Since controls can be considered state machines, sometimes it's useful
2956 to support multiple instances of a control in a desklet. This can be done
2957 by instantiating the control with the <property>length</property> property
2958 explicitly set. With this set at load-time, the control will only be
2959 accessible like a list and will be expandable with the
2960 <property>length</property> property. If you do not, the control may not
2961 necessarily provide the <property>length</property> property, will be
2962 accessible as shown above, and will not be expandable. In other words,
2963 existing desklets will continue to work as they are.</para>
2964
2965 <programlisting><![CDATA[
2966...
2967<control id="myctrl" interface="ITime:9y703dqtfnv4w373caserz68r" length="1"/>
2968
2969<script>
2970 Dsp.lbl1.value = str(myctrl[0].time)
2971</script>
2972...
2973 ]]></programlisting>
2974
2975 <para>For compatibility with this feature, you should not implement a
2976 <property>length</property> property in your control.</para>
2977
2978</section>
2979
2980
2954</section>2981</section>
2955 <section xmlns:xi="http://www.w3.org/2001/XInclude" id="ctrl-write">2982 <section xmlns:xi="http://www.w3.org/2001/XInclude" id="ctrl-write">
2956 <title>Writing Controls</title>2983 <title>Writing Controls</title>
29572984
=== modified file 'xibook.xml'
--- xibook.xml 2010-05-23 23:23:27 +0000
+++ xibook.xml 2010-06-18 01:30:41 +0000
@@ -29,7 +29,7 @@
29 </author>29 </author>
30 </authorgroup>30 </authorgroup>
3131
32 <edition>Developer's Book for gDesklets v0.36.2</edition>32 <edition>Developer's Book for gDesklets v0.36.3(beta)</edition>
33 <pubdate>2010</pubdate>33 <pubdate>2010</pubdate>
3434
35 <copyright>35 <copyright>
@@ -43,7 +43,7 @@
43 </copyright>43 </copyright>
4444
45 <releaseinfo>45 <releaseinfo>
46 This book describes version 0.36.2 of the gDesklets platform.46 This book describes version 0.36.3(beta) of the gDesklets platform.
47 </releaseinfo>47 </releaseinfo>
4848
49 <legalnotice>49 <legalnotice>

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: