Multipage gui handling problem-All pages appear at once before dissappearing
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I am making a multipage gui and I have the following problem : Even though my code works, when I open the first gui page all the other pages appear for a sec before dissapearing. This makes sense though since I have this code in my first gui's opening function :
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
handles.s1= model_simulation;
handles.s2= model_evaluation;
set(handles.s1,'Visible','off');
set(handles.s2,'Visible','off');
h1=guidata(handles.s1);
h1.sim = handles.s1;
h1.back = hObject;
guidata(handles.s1,h1);
h2=guidata(handles.s2);
h2.eval = handles.s2;
h2.back = hObject;
guidata(handles.s2,h2);
% Update handles structure
guidata(hObject, handles);
So, the gui opening func at first creates the handles for the next pages (apparently also showing them and initializing them) and then sets them to invisible. Then in the one of my next buttons I have this code :
set(handles.output,'Visible','off');
set(handles.s2,'Visible','on');
How I can prevent this from happening? The problem is not just that all pages appear at once before dissapearing but also the listboxes in all my guis are initialised at first when I open my first gui. Now, in my first gui I perform some actions and a file is saved to a folder. When I press the eval(i.e next) button the new file is not appearing in the listbox of that next page since that listbox has been already initialized and is not updated. I tried to paste the code above in other parts of the fist gui script but it doesn't seem to work. Any ideas? Or at least a way to update the listboxes once again without having an update pushbutton?
0 comentarios
Respuestas (1)
Image Analyst
el 7 de En. de 2015
What is a multi-page gui? I'm not sure I follow what you're doing (screenshots would help with that), but you can call "drawnow" whenever you want to "manually" force an update/refresh/repaint of the figure/axes/gui that you've last interacted with.
2 comentarios
Image Analyst
el 7 de En. de 2015
So by pages you mean "figures" or "windows", and by connected/combined you mean like you set the "Position" property so that those GUIs are located next to each other on the screen? Why not just put them into panels all on one GUI and then set the visibility of the panel on or off when you want them appear or disappear?
Ver también
Categorías
Más información sobre Dialog Boxes en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!