From: Beskie on 14 Apr 2010 18:11 I'm writing a GUI with guide and it has 7 pop-up windows for the user to enter information depending on the product. They only fill out one of the seven pop-ups. Each pop-up menu has 20-25 edit boxes and I'm using setappdata and getappdata to transfer the information back to my main program. My question is, is there a simple way to loop through the handles.Edit1....Edit25 and read the strings? Or am I stuck with 25 lines of setappdata(Main_GUI, 'string1', get(handles.Edit1,'string')? or is there better altenative method? Thanks, Beth
From: Nathan on 14 Apr 2010 18:19 On Apr 14, 3:11 pm, Beskie <beskie...(a)yahoo.com> wrote: > I'm writing a GUI with guide and it has 7 pop-up windows for the user > to enter information depending on the product. They only fill out one > of the seven pop-ups. Each pop-up menu has 20-25 edit boxes and I'm > using setappdata and getappdata to transfer the information back to my > main program. My question is, is there a simple way to loop through > the handles.Edit1....Edit25 and read the strings? Or am I stuck with > 25 lines of > > setappdata(Main_GUI, 'string1', get(handles.Edit1,'string')? > > or is there better altenative method? > > Thanks, > Beth Try something like this: for a=1:25 setappdata(Main_GUI,sprintf('string%d',a),get(handles.(sprintf('Edit %d',a)),'string') end -Nathan
From: Beskie on 14 Apr 2010 18:28 That worked perfectly, thank you!
|
Pages: 1 Prev: Setting image data using spatial coordinates Next: repmat without tiling? |