[scilab-Users] Graphic interfaces

Vincent COUVERT vincent.couvert at scilab.org
Thu Dec 30 11:15:26 CET 2010


Hi Jean-Louis,

Your callback functions must not take input arguments because when they 
are called, "B_style" and "A_style" are undefined.

The good way to manage your test case is to identify your buttons using 
a tag (see the tag property), then using findobj to get them in your 
callback functions and finally setting the string value.

// Creation
A_style.tag = "A_style"

// Callback function
A_style = findobj("Tag", "A_style");
A_style.string = "B";

Regards,
Vincent



Le 28/12/10 17:09, Jean-Louis Auge a écrit :
> Dear users,
>
> I attempted to do a little program to change the label of a pushbutton 
> but the result is was inconclusive.
>
> Here the programm:
>
> //Initialisation stage
> clear all;
> clc;
> for i=0:100, close(i), end;
>
>
> //to change the label of the button A
> function [A_style]=changeA(B_style,A_style)
>  A_style.String="B"
>  disp("go through changeA")
> endfunction;
>
> //to change the label of the button B
> function [B_style]=changeB(A_style)
>  B_style.String="A"
>  disp("go through changeB")
> endfunction;
>
>
> h=scf();
> h.position=[0 0 1000 800];
> A_style=uicontrol(h,"style", "pushbutton");
> A_style.Units="normalized";
> A_style.Position = [0 0.95 0.2 0.05];
> A_style.BackgroundColor="1|0|1";
> A_style.Fontsize=20;
> A_style.String = "A";
> A_style.Callback="changeB";
>
> B_style=uicontrol(h,"style", "pushbutton");
> B_style.Units="normalized";
> B_style.Position = [0 0 0.2 0.05];
> B_style.BackgroundColor="1|0|1";
> B_style.Fontsize=20;
> B_style.String = "B";
> B_style.Callback="changeA";
>
>
> I wanted change the label of  the pressbutton A pushing the button B 
> and vice versa.
> The result is inconclusive.
>
> Does somebody meet this case in this development.
>
> Moreover, do you know websites where graphic interfaces documentations 
> are given? I did not find many comments about the subject.
> Is Scilab often use to develop interface graphics?
>
> Best regards,
>
> JL.
>
>
>



More information about the users mailing list