<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Le 20/12/2016 21:45,
<a class="moz-txt-link-abbreviated" href="mailto:paul.carrico@free.fr">paul.carrico@free.fr</a> a écrit :<br>
</div>
<blockquote cite="mid:8ce8d033ed5c8392dbfbe8be957a887b@free.fr"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div class="pre" style="margin: 0; padding: 0; font-family:
monospace">Hi<br>
<br>
I've been looking to the wiki and an interesting article
speaking about GUI developments (<a moz-do-not-send="true"
href="https://fr.wikibooks.org/wiki/D%E9couvrir_Scilab/Cr%E9er_une_interface_graphique_GUI"
target="_blank" rel="noreferrer">https://fr.wikibooks.org/wiki/Découvrir_Scilab/Créer_une_interface_graphique_GUI</a>
- in French language).</div>
<div class="pre" style="margin: 0; padding: 0; font-family:
monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family:
monospace">I've a naive question on the code hereafter: why is
it possible to implement several values? no loop is needed nor
any breack condition ... surprising but I do not understand :-)
(naive question I confess)</div>
</blockquote>
<br>
If i understand well your question -- rather the same than Jens's
one, that likes loops too, mainly "while" ones embeding xclick() :)
--, i would answer the same that i did to him:<br>
A callback is a local (asynchronous) script that is executed each
time that the interactive component defining it is activated.<br>
So here, each time you press the x^2 button, each time its callback
is executed.<br>
<br>
In the callback, the instruction <br>
<pre><span>x = evstr(e.string);
</span></pre>
<span>is not robust, because at the moment the button is pressed,
the variable "e"</span><br>
<span>may no longer exist. Clearing it or overwriting it with
something else </span><span><span> in the meantime<br>
</span>does</span><span> not affect the graphic component. "e" is
just a handle (while delete(e) would really<br>
delete the component).<br>
For a robust implementation, <tt>gcbo.string</tt></span><span> is
required instead.</span><br>
<span></span><br>
HTH<br>
Samuel<br>
<span><br>
</span>
</body>
</html>