[問題] GUI問題: Invalid handle?

看板MATLAB作者 (懶洋洋)時間11年前 (2013/05/10 01:21), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
請問一下各位 我是用switchyard寫GUI global Data handle 在figure設了一個panel: handle.strPanel = uipanel('Tag','strPanel','Position',[.01 .01 .49 .85]); 在panel上設定uicontrol: for q=1:5 handle.NK(q)=uicontrol('Style','pushbutton',............, 'parent',handle.strPanel); end 因為handle.NK的層數會隨case改變 (可能是5,可能是10) 所以我另外設了一個清除鍵,內容如下 delete(handle.strPanel); handle.strPanel = uipanel('Tag','strPanel','Position',[.01 .01 .49 .85]); 接下來重畫 : handle.strPanel = uipanel('Tag','strPanel','Position',[.01 .01 .49 .85]); for q=1:10 handle.NK(q)=uicontrol('Style','pushbutton',............, 'parent',handle.strPanel); end 問題來了!! GUI介面上很成功的顯示了重劃的pushbutton, 但是!! 我接下來要找 Data.indexdata=get(handle.NK,'string'); 卻顯示了Invalid handle 天啊! 為什麼會這樣呢? handle.NK明明有出現在介面上啊 請高手幫忙解惑 感激不盡~~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.194.193.199
文章代碼(AID): #1HYziqgQ (MATLAB)