[Scilab-Dev] potential problems with Scilab's uicontrol

Vincent COUVERT vincent.couvert at scilab.org
Tue Nov 24 15:43:54 CET 2009


Hi Stéphane,

Let's take an example:
f = figure();
uicontrol('Parent',f,'Position',[10 10 40 20],'string','test')

This code gives the same result under Scilab 4.1.2, Scilab 5.1.1 and 
Matlab (the reference for uicontrol position is the bottom left corner 
of the figure).

The problem occurs when the user resizes the figure:
 - Matlab: the uicontrol position does not change
 - Scilab 4.1.2: the uicontrol position changes on screen but not in its 
properties (too bad!)
 - Scilab 5.1.1  the uicontrol position changes on screen and in its 
properties

The problem we have since the beginning of uicontrols in Scilab in this 
change of position according to the figure resize. We should perhaps 
consider to change this behavior to be consistent with Matlab one but we 
have first to check if this does not produce other problems.

I just reported a bug (http://bugzilla.scilab.org/show_bug.cgi?id=5477) 
so that we investigate the problem.

Vincent

StŽéphane Mottelet a écrit :
> Hi all,
>
> Since I am currently evaluating if it is worth uising Scilab's
> uicontrols (instead of Tk widgets), I would like to warn the
> Scilab team that these uicontrols have a strange non-standard
> behavior (with respect to any gui system) : once an
> uiconcontrol has been created, i.e. :
>
> f=gcf();
> h=uicontrol(f,'style','frame');
>
> the "position" field of the uicontrol changes each time the figure is
> resized.
> I am sorry to be so crude, but I cannot imagine that people who have
> decided that uicontrols should behave this way have ever programmed
> any serious gui :-)
>
> The problem is very simple : the origin of the screen coordinate system
> (the one for uicontrols) should be on the upper-left corner of the window
> (this is the case in Matlab).
> In Scilab, it is  located in the lower-left corner : this makes all the
> stuff very tricky and/or unusable as an alternative to Tk.
>
> hth
>
> S.
>



More information about the dev mailing list