[Scilab-users] callback and output variables

classic Classic list List threaded Threaded
2 messages Options
anna78 anna78
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] callback and output variables

Hi all,

I'm trying to write my first GUI and I would ask you a suggestion.

My GUI will have a "Load button" needed to allow the user to select a file,
the GUI will analyze later on.
I would need the selected file name available even when the "Load button"
callback-function ends.

Is there any way to write the filename (and few other parameters) to a
"global variable", such that I can read from other sub-functions, too?

many thanks,
Anna





--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
RolandB RolandB
Reply | Threaded
Open this post in threaded view
|

Re: callback and output variables

Hi,

in the callback function you can access the calling GUI element with gcbo.
As those elements have an userdata property, you can assign an array or list
to that property and then access this array or list from elsewhere.

In the callback function:

my_array_or_list(1)=uigetfile();

my_array_or_list(2)="what_else_you_need";

set(gcbo, "userdata", my_array_or_list);

And if you want to access the data:

my_array_or_list=get(findobj("tag";"the_tag_you_had_defined_for_your_button"),
"userdata");







--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users