Handles and data between Gui's

hey , i have to guis and i want to put values of the first window in second , how can i do it
i use setappdata , and getappdata , but i think i didn't use it on right way

8 件のコメント

Rik
Rik 2021 年 5 月 10 日
Does one of them call the other? Or can both GUIs be expected to be unique (i.e. that only one of them will run at any point in time)?
outmane charrouf
outmane charrouf 2021 年 5 月 10 日
well , first i have a gui ,i open it , i do my calculations , then i want to stock the result in table in new window of this gui (first GUI has many windows (edit save quite and my gui who containt the table)
outmane charrouf
outmane charrouf 2021 年 5 月 10 日
i want to use setappdata and getappdata
Rik
Rik 2021 年 5 月 10 日
If it is a second window of that same program, you can easily pass the handle to the main GUI figure as an argument when creating the second GUI. You can use setappdata and getappdata, but guidata is also an option.
Jan
Jan 2021 年 5 月 10 日
Are the GUIs figure or uifigures? Are you using GUIDE, AppDesigner or do you create the GUIs by code?
Rik
Rik 2021 年 5 月 10 日
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread.
outmane charrouf
outmane charrouf 2021 年 5 月 10 日
in the first window i do
k=900 ;
setappdata(hdltest.fenetre,'TEST',k);
in second i do :
k=getappdata(hdltest.fenetre,'TEST');
set(hdltest2.case(1),'String',num2str(k));
and error was :
Struct contents reference from a non-struct array object.
Error in **** (line 5684)
k=getappdata(hdltest.fenetre,'TEST');
Error while evaluating UIControl Callback.
Rik
Rik 2021 年 5 月 10 日
How are you transfering the handle from the first to the second GUI? How do you expect us to fix this issue for you if you don't answer the questions we post? You haven't actually answered any of our questions so far.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

タグ

質問済み:

2021 年 5 月 10 日

コメント済み:

Rik
2021 年 5 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by