作者easterly (??)
看板MATLAB
标题[讨论] Guide中另外写callback的问题~
时间Sat Nov 24 18:05:44 2012
我是GUI新手 请问一下大家
我目前是用guide的方式写GUI
其中有需要浮动的push bottom
所以我在Guide介面设了一个psubottom 里面的callbak是会产生其他的按钮
function strucset_Callback(hObject, eventdata, handles)
global handle
global Data
for q=1:Data.L
handle.NK(q)=uicontrol('Style','pushbutton','Units','normalized','Position',
[2*Wid Wid+yy-1.5*(q-1)*Wid2 3*Wid
Wid2],'fontsize',9,'backgroundcolor','w','Callback',
????
,'Tag',num2str(q));
end
就是黄色字的部分 问题在於我不知道要怎麽在callback中再写一个callback = =
我想要读入一个txt的data档
[filename,pathname]=uigetfile('*.txt','Load *.txt file');
if filename~=0 % 当filename不为0时
nk=importdata([pathname filename]);
set(gco,'String',sprintf('%s',[filename]));
% 在目前的物件里显示此档案位置
else
set(gco,'String',sprintf('%s',[]));
end
请能人帮我解答 感激不尽~~
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.171.35
1F:推 ak075:用function呼叫 11/25 02:07