フィルターのクリア

CONNECT TWO .FIG IN GUI

5 ビュー (過去 30 日間)
Fiboehh
Fiboehh 2011 年 3 月 6 日
コメント済み: Walter Roberson 2016 年 4 月 1 日
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

採用された回答

Matt Fig
Matt Fig 2011 年 4 月 20 日
What do you mean by "link two .fig windows" exactly? Do you mean you want to pass data from one figure to another via a pushbutton? Please provide a very descriptive example of exactly what you want to do.
  3 件のコメント
Matt Fig
Matt Fig 2011 年 4 月 20 日
uicontrol('styl','push','call','figure(''name'',''new Figure'');close(gcbf)')
If you don't use callback strings, create the second figure in the callback to the pushbutton, then call: close(gcbf)
Fiboehh
Fiboehh 2011 年 4 月 20 日
Ow, it don't work. But with open('DA.fig') and then close(gcbf) works it fine. Dont know of its a bad way but it finally opens a selected window and close the original :)
thanx man!

サインインしてコメントする。

その他の回答 (5 件)

Walter Roberson
Walter Roberson 2011 年 3 月 6 日
Please have a look at the FAQ

Fiboehh
Fiboehh 2011 年 3 月 6 日
Okj i fount out myself after a whole day searching ( i'm a f*cking idiot) that it works as next for:
function pushbutton10_Callback(hObject, eventdata, handles)
open DataAcquisition.fig
to go to an other .fig gui. But now there are two windows open and thats not the goal... Anyone who knows how to avoid that.
just close dont work!
Grtz

Walter Roberson
Walter Roberson 2011 年 3 月 6 日
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
Fiboehh 2011 年 4 月 20 日
Allright after 1 month i dont know how to do it. I'm a f*cking big noob. Maybe you can say me where the figure object in the main GUI menu is :)
  2 件のコメント
Walter Roberson
Walter Roberson 2011 年 4 月 20 日
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
Paulo Silva 2011 年 4 月 20 日
@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
Soumya Shanbhag 2016 年 4 月 1 日
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 件のコメント
Walter Roberson
Walter Roberson 2016 年 4 月 1 日
newfig = figure();
newax = axes('Parent', newfig);
imshow(YourImageArray, 'Parent', newax);
axis(newax, 'image', 'tight');

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by