0
我試圖在使用嵌套面板的GUI中創建滾動列表。但是,每當我試圖移動滾動條的GUI,我收到此錯誤:GUI滾動條錯誤
??? Error using ==> PyroGUI>slider Too many input arguments.
??? Error while evaluating uicontrol Callback
這裏是我的代碼:
screensize=get(0,'ScreenSize');
handles.fig=figure('Position',[100 100 screensize(3)-150 screensize(4)-150]);
handles.hpanel=uipanel(handles.fig,'Position',[0.005 0.01 0.99 0.99],'Title','Panel');
handles.hsp = uipanel('Parent',handles.hpanel,'Title','Subpanel','FontSize',12,...
'Position',[.025 .05 .3 .935]);
handles.hpop = uicontrol('Style', 'slider',...
'Position', [20 30 20 700],...
'Min',1,'Max',700,'Value',700,...
'callback', {@slider,handles.hsp});
handles.pos=get(handles.hpanel,'Position');
function slider()
slidervalue=get(handles.hpop,'Value');
set(handles.hpanel,'Position',[handles.pos(1) handles.pos(2)-slidervalue+1 handles.pos(3) handles.pos(4)]);
end
任何想法,這可能是導致此?