CONNECT TWO .FIG IN GUI
Afficher commentaires plus anciens
Hellow, im looking for a very short code to link two gui .fig windows to each other. I have spilled so mucht time on looking over the internet and nowhere i can find it :( Example: from a window to another with a next buttom. It seems so easy but i really cant find it!
PLEASE ANYONE HELP ME
Réponse acceptée
Plus de réponses (5)
Walter Roberson
le 6 Mar 2011
0 votes
Fiboehh
le 6 Mar 2011
Walter Roberson
le 6 Mar 2011
The handle structure for GUI created with GUIDE are stored in the figure object for the main GUI menu.
gui1fig = open('FirstGui.fig');
gui2fig = open('SecondGui.fig');
Then if the first GUI needs to reference a handle that exists in the second GUI,
handles2 = getappdata(gui2fig);
and access handles2.TheHandleName
If need be, the second handles structure can be updated from the first GUI by using
setappdata(gui2fig, handles2)
Fiboehh
le 20 Avr 2011
0 votes
2 commentaires
Walter Roberson
le 20 Avr 2011
Reverse parse. The main GUI is a figure. Figures have a number of properties, one of which is ApplicationData. GUIDE stores the "handles" structure for the GUI in that property of the figure. Given the figure number, you can access that handles structure by using getappdata() with the figure number. The figure number that a .fig was opened as will be returned by the open() call.
Thus, my answer about handles and GUIDE was intended to be a recipe for how to proceed; the only part that was missing was information on how to communicate the figure numbers to the code, which is something there are multiple ways to do.
Paulo Silva
le 20 Avr 2011
@Fiboehh don't say those bad things about yourself, everybody needs time to learn, it often takes months or even years (my ongoing process), Matt Fig and Walter Roberson will guide you, good luck.
Soumya Shanbhag
le 1 Avr 2016
0 votes
when I press on push button it closes current gui and display the image in that gui. Now I want to create one more push button in that display window where image is being displayed.
1 commentaire
Walter Roberson
le 1 Avr 2016
newfig = figure();
newax = axes('Parent', newfig);
imshow(YourImageArray, 'Parent', newax);
axis(newax, 'image', 'tight');
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!