Le 20/12/2016 21:45, [email protected] a écrit :
Hi

I've been looking to the wiki and an interesting article speaking about GUI developments (https://fr.wikibooks.org/wiki/Découvrir_Scilab/Créer_une_interface_graphique_GUI <https://fr.wikibooks.org/wiki/D%E9couvrir_Scilab/Cr%E9er_une_interface_graphique_GUI> - in French language). 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)

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: A callback is a local (asynchronous) script that is executed each time that the interactive component defining it is activated. So here, each time you press the x^2 button, each time its callback is executed.

In the callback, the instruction

x = evstr(e.string);

is not robust, because at the moment the button is pressed, the variable "e"
may no longer exist. Clearing it or overwriting it with something else in the meantime doesnot affect the graphic component. "e" is just a handle (while delete(e) would really
delete the component).
For a robust implementation, gcbo.stringis required instead.

HTH
Samuel

_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to