<term>Callback_Type</term>
<listitem>
<para>Scalar</para>
- <para>The type of callback transmitted to the uicontrol.</para>
+ <para>The type of callback transmitted to the uicontrol (see example below).</para>
<itemizedlist>
<listitem>
<para>
</listitem>
<listitem>
<para>
- <literal>0</literal> or <literal>2</literal> a Scilab instruction
+ <literal>0</literal> (by default) or <literal>2</literal> a non prioritary, interruptible Scilab instruction
+ </para>
+ <para>
<literal>10</literal> or <literal>12</literal> a prioritary, non-interruptible Scilab instruction
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
+ <refsection>
+ <title>Example for callback_type property</title>
+ <programlisting role="example"><![CDATA[
+function counter_start()
+ // Callback called after a click on start pushbutton
+ global Stop
+ Stop=%f;
+ while %t
+ i = evstr(get("count", "string"));
+ set("count", "string", string(i+1));
+ if Stop then
+ break
+ end
+ end
+endfunction
+
+function counter_stop()
+ // Callback called after a click on stop pushbutton
+ global Stop
+ Stop=%t
+endfunction
+
+function counter_reinit()
+ // Callback called after a click on reset pushbutton
+ Stop=%t
+ set("count", "string", "0");
+endfunction
+
+
+counter_main_fig = figure( ...
+"dockable", "off", ...
+"infobar_visible", "off", ...
+"toolbar_visible", "off", ...
+"toolbar", "none", ...
+"menubar_visible", "off", ...
+"menubar", "none", ...
+"layout", "none", ...
+"visible", "off", ...
+"resize", "off", ...
+"figure_position", [0 0], ...
+"axes_size", [400, 150], ...
+"figure_name", "Counter", ...
+"layout", "gridbag", ...
+"tag", "counter_main_figure");
+
+
+// Counter frame
+counter_frame = uicontrol(counter_main_fig, ...
+"layout", "gridbag", ...
+"style", "frame", ...
+"constraints", createConstraints("gridbag", [1, 1, 1, 1], [1, 0.5], "both"));
+
+uicontrol(counter_frame, ...
+"style", "text", ...
+"string", "Counter : ", ...
+"constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.5, 1], "horizontal", "center"), ...
+"margins", [5 5 5 5], ...
+"horizontalAlignment", "center");
+
+uicontrol(counter_frame, ...
+"style", "text", ...
+"string", "0", ...
+"constraints", createConstraints("gridbag", [2, 1, 1, 1], [1, 1], "horizontal", "center"), ...
+"tag", "count", ...
+"margins", [5 5 5 5]);
+
+// Buttons frame
+buttons_frame = uicontrol(counter_main_fig, ...
+"layout", "gridbag", ...
+"style", "frame", ...
+"constraints", createConstraints("gridbag", [1, 2, 1, 1], [1, 1], "both"));
+
+// The associated callback needs to be interruptible (when clicking on stop or reset for example)
+uicontrol("parent", buttons_frame, ...
+"Style" , "pushbutton", ...
+"String" , "Start", ...
+"callback" , "counter_start()", ...
+"margins", [5 5 5 5], ...
+"constraints", createConstraints("gridbag", [1, 1, 1, 1], [1, 1], "horizontal", "center"));
+
+// The associated callback needs to have priority in order to interrupt the current callback (in other words to stop the counter)
+uicontrol("parent", buttons_frame, ...
+"Style" , "pushbutton", ...
+"String" , "Stop", ...
+"callback" , "counter_stop()", ...
+"callback_type", 10, ...
+"constraints", createConstraints("gridbag", [2, 1, 1, 1], [1, 1], "horizontal", "center"), ...
+"margins", [5 5 5 5]);
+
+// The same for the callback which reset the counter: it must have the priority over the callback which has started the counter
+uicontrol("parent", buttons_frame, ...
+"Style" , "pushbutton", ...
+"String" , "Reset", ...
+"callback" , "counter_reinit()", ...
+"callback_type", 10, ...
+"constraints", createConstraints("gridbag", [3, 1, 1, 1], [1, 1], "horizontal", "center"), ...
+"margins", [5 5 5 5]);
+
+counter_main_fig.visible = "on";
+ ]]></programlisting>
+ </refsection>
<refsection role="see also">
<title>See Also</title>
<simplelist type="inline">
<title>History</title>
<revhistory>
<revision>
+ <revnumber>6.0.0</revnumber>
+ <revremark>
+ <para>
+ By default, callback_type property is now interruptible but non prioritary.
+ </para>
+ </revremark>
+ </revision>
+ <revision>
<revnumber>5.5.0</revnumber>
<revremark>
<para>
<term>Callback_Type</term>
<listitem>
<para>Scalar</para>
- <para>The type of callback transmitted to the uicontrol.</para>
+ <para>The type of callback transmitted to the uicontrol (see example below).</para>
<itemizedlist>
<listitem>
<para>
</listitem>
<listitem>
<para>
- <literal>0</literal> or <literal>2</literal> a Scilab instruction
+ <literal>0</literal> (by default) or <literal>2</literal> a non prioritary, interruptible Scilab instruction
+ </para>
+ <para>
<literal>10</literal> or <literal>12</literal> a prioritary, non-interruptible Scilab instruction
</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
+ <refsection>
+ <title>Example for callback_type property</title>
+ <programlisting role="example"><![CDATA[
+function counter_start()
+ // Callback called after a click on start pushbutton
+ global Stop
+ Stop=%f;
+ while %t
+ i = evstr(get("count", "string"));
+ set("count", "string", string(i+1));
+ if Stop then
+ break
+ end
+ end
+endfunction
+
+function counter_stop()
+ // Callback called after a click on stop pushbutton
+ global Stop
+ Stop=%t
+endfunction
+
+function counter_reinit()
+ // Callback called after a click on reset pushbutton
+ Stop=%t
+ set("count", "string", "0");
+endfunction
+
+
+counter_main_fig = figure( ...
+"dockable", "off", ...
+"infobar_visible", "off", ...
+"toolbar_visible", "off", ...
+"toolbar", "none", ...
+"menubar_visible", "off", ...
+"menubar", "none", ...
+"layout", "none", ...
+"visible", "off", ...
+"resize", "off", ...
+"figure_position", [0 0], ...
+"axes_size", [400, 150], ...
+"figure_name", "Counter", ...
+"layout", "gridbag", ...
+"tag", "counter_main_figure");
+
+
+// Counter frame
+counter_frame = uicontrol(counter_main_fig, ...
+"layout", "gridbag", ...
+"style", "frame", ...
+"constraints", createConstraints("gridbag", [1, 1, 1, 1], [1, 0.5], "both"));
+
+uicontrol(counter_frame, ...
+"style", "text", ...
+"string", "Counter : ", ...
+"constraints", createConstraints("gridbag", [1, 1, 1, 1], [0.5, 1], "horizontal", "center"), ...
+"margins", [5 5 5 5], ...
+"horizontalAlignment", "center");
+
+uicontrol(counter_frame, ...
+"style", "text", ...
+"string", "0", ...
+"constraints", createConstraints("gridbag", [2, 1, 1, 1], [1, 1], "horizontal", "center"), ...
+"tag", "count", ...
+"margins", [5 5 5 5]);
+
+// Buttons frame
+buttons_frame = uicontrol(counter_main_fig, ...
+"layout", "gridbag", ...
+"style", "frame", ...
+"constraints", createConstraints("gridbag", [1, 2, 1, 1], [1, 1], "both"));
+
+// The associated callback needs to be interruptible (when clicking on stop or reset for example)
+uicontrol("parent", buttons_frame, ...
+"Style" , "pushbutton", ...
+"String" , "Start", ...
+"callback" , "counter_start()", ...
+"margins", [5 5 5 5], ...
+"constraints", createConstraints("gridbag", [1, 1, 1, 1], [1, 1], "horizontal", "center"));
+
+// The associated callback needs to have priority in order to interrupt the current callback (in other words to stop the counter)
+uicontrol("parent", buttons_frame, ...
+"Style" , "pushbutton", ...
+"String" , "Stop", ...
+"callback" , "counter_stop()", ...
+"callback_type", 10, ...
+"constraints", createConstraints("gridbag", [2, 1, 1, 1], [1, 1], "horizontal", "center"), ...
+"margins", [5 5 5 5]);
+
+// The same for the callback which reset the counter: it must have the priority over the callback which has started the counter
+uicontrol("parent", buttons_frame, ...
+"Style" , "pushbutton", ...
+"String" , "Reset", ...
+"callback" , "counter_reinit()", ...
+"callback_type", 10, ...
+"constraints", createConstraints("gridbag", [3, 1, 1, 1], [1, 1], "horizontal", "center"), ...
+"margins", [5 5 5 5]);
+
+counter_main_fig.visible = "on";
+ ]]></programlisting>
+ </refsection>
<refsection role="see also">
<title>参照</title>
<simplelist type="inline">
<title>履歴</title>
<revhistory>
<revision>
+ <revnumber>6.0.0</revnumber>
+ <revremark>
+ <para>
+ By default, callback_type property is now interruptible but non prioritary.
+ </para>
+ </revremark>
+ </revision>
+ <revision>
<revnumber>5.5.0</revnumber>
<revremark>
<para>