f



How to set or get value of edit text on another gui

In my main Gui, I am trying to use callback to display another GUI
but I don't know how to change the value of edit component in the
second gui. Who can tell me how to do it. Thank you in advance
0
fzhu1 (1)
7/26/2004 6:05:02 PM
comp.soft-sys.matlab 211266 articles. 23 followers. lunamoonmoon (257) is leader. Post Follow

1 Replies
371 Views

Similar Articles

[PageSpeed] 16

"frank zhu" <fzhu@tracedetection.com> wrote in message
news:eee4469.-1@webx.raydaftYaTP...
> In my main Gui, I am trying to use callback to display another GUI
> but I don't know how to change the value of edit component in the
> second gui. Who can tell me how to do it. Thank you in advance

You need to use one of several(!) ways of transferring data. For instance,
using tags:
figure;
h1 = uicontrol('pos',[10 10 100 20],'style','pushbutton','string','Add
1','callback','set(findobj(''tag'',''h2''),''string'',str2num(get(findobj(''
tag'',''h2''),''string''))+1)');
h2 = uicontrol('pos',[10 100 100 300],'style','edit','string',1,'tag','h2');

Note that most here wouldn't suggest this as the BEST method...just here for
illustration. (Still, it works well.) Can also be done with global
variables, userdata, evalin/assignin, appdata, reading/writing to/from
files, passing variables directly, etc.
Suggest you do a bit of reading about workspaces.
Brett


0
shoelson (825)
7/26/2004 6:24:14 PM
Reply: