From: Adam on 24 Jun 2010 20:05 Hi, This question is a bit general and may be hard to answer, but I'll give a shot. I currently have two very similar GUIs that basicly are running two modes of the same algorithm, and am trying to merge them into one. It consists of two panels (One for input and one for results) with many plots, boxes and subpanels. Although they are similar in layout, there will be some objects (textboxes, graphs) that need to disappear or reappear upon switch from one mode to the other. I'll then have to put a bunch of if statements in the callbacks depending on which mode the GUI is in. My question is: Is it standard to have objects on top of each other that go from visible to hidden and such or is there a better way to do this. I think it would work, but I would like to know if others have tried and if there a standard way to create dynamic GUIs. Another option would be keeping both GUIs in separate files and somehow run one then upon clicking, close it and open the other one in the same figure. I'm relatively new to MATLAB GUI design and was wondering how this is typically dealt with. Thanks a lot, Adam
From: Matt Fig on 24 Jun 2010 20:17 I don't know if it is "standard," but it is certainly acceptable if done smoothly. There example of this in here: http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples See the answer to question #37.
From: Christopher on 24 Jun 2010 21:49 "Adam " <abc5(a)ubc.ca> wrote in message <i00rrj$ptb$1(a)fred.mathworks.com>... > Hi, > > This question is a bit general and may be hard to answer, but I'll give a shot. I currently have two very similar GUIs that basicly are running two modes of the same algorithm, and am trying to merge them into one. It consists of two panels (One for input and one for results) with many plots, boxes and subpanels. Although they are similar in layout, there will be some objects (textboxes, graphs) that need to disappear or reappear upon switch from one mode to the other. I'll then have to put a bunch of if statements in the callbacks depending on which mode the GUI is in. > > My question is: Is it standard to have objects on top of each other that go from visible to hidden and such or is there a better way to do this. I think it would work, but I would like to know if others have tried and if there a standard way to create dynamic GUIs. Another option would be keeping both GUIs in separate files and somehow run one then upon clicking, close it and open the other one in the same figure. I'm relatively new to MATLAB GUI design and was wondering how this is typically dealt with. > > Thanks a lot, > > Adam If you're sharing data between the two instances it may get messy trying to open a new one. Definately possible but it would be easier to manage the data if you just went with option one. There are ways to do tabs in a GUI - at least I have seen it done.. I don't think it's part of the standard MATLAB library but you may find it on the File Exchange. That would seem the most logical way for me.. The first solution posed is definately possible - the best way to do it may be to ensure that all objects to be turned off are grouped onto the one panel so you can just change it with: set(handles.panel1,'visible','off','handlevisibility','off'); set(handles.panel2,'visible','on','handlevisibility','on'); without having to do it for each individual object.. Good luck!
From: Adam on 25 Jun 2010 12:22 Excellent, thanks for the help. I love the panel idea this should simplify things greatly, it's a rather complex GUI. Thanks a lot.
|
Pages: 1 Prev: Gauss-Seidel Method Next: Some posts about neural network |