[Scilab-Dev] uiwait()

Clément David clement.david at scilab-enterprises.com
Wed Apr 20 19:26:10 CEST 2016


Hi Samuel,

Le jeudi 14 avril 2016 à 00:20 +0200, Samuel Gougeon a écrit :
> Le 13/04/2016 20:43, Samuel Gougeon a écrit :
> > Hello Scilab devs,
> > 
> > uiwait() is a builtin used once and only in the function datatipCreatePopupMenu().
> > Apparently, it is used to wait for an answer from the user/Context menu before returning.
> > 
> > Can this function be used for other uicontrols?
> > I mean: it would be useful to be able to turn modal some (any?) ui object,
> > for instance waiting for a button being clicked, for an item in a drop-down 
> > list to be selected, etc, before going on with the processing.
> > 
> > This function is not documented. Is it on purpose? Can it be used only on
> > a uiContextMenu handle?
>  A trial answers:
> --> uiwait(gca())
> 
> uiwait: Wrong type for input argument #1: A 'Uicontextmenu' handle expected.
> 
> A pity.
> By the way, datatipCreatePopupMenu() seems to be some dead code,
> with some other SCI\modules\graphics\macros\datatips\* macros.

Hmm do you mean that we might block scilab, waiting for axes / figure deletion ? currently this is
not the case as both uicontrols callbacks and the console push commands to the Scilab queue.
Blocking the Scilab execution thread will deadlock them. Currently such a management might be done
in Scilab using a `while %t` loop managing some `get_click()` return value.

>From the user point of view, indeed it might be useful to let the user implements a complex modal
dialog using uicontrols with ease (this call might just hide a `while %t` loop). IMHO we might also
implement the matlab behavior [1] with : uiresume() and waitfor() (or uiwaitfor() ).

[1]: http://fr.mathworks.com/help/matlab/ref/uiwait.html

Thanks for the idea, could you open a bug to track it ?

--
Clément




More information about the dev mailing list