Is it possible to enable a slider to scroll subpanels up and down?

1 回表示 (過去 30 日間)
Cordelle
Cordelle 2013 年 6 月 12 日
My GUI has an add button that allows the user to add additional subpanels when desired. Being that eventually the length of the subpanels will exceed the length of the computer screen. I thought that an scroll bar would be useful; however, I need the scroll bar's parameters to change with every additional subpanel added.
Any example of how to implement such a slider/scroll bar would be greatly appreciated.
Links to any site that you think will help will be appreciated too.
Thank you in advance

採用された回答

David Sanchez
David Sanchez 2013 年 6 月 12 日
The following link explains the steps to add a scrollbar to your GUI:
  2 件のコメント
Cordelle
Cordelle 2013 年 6 月 12 日
I implemented something similar to my GUI and an error message occured:
Reference to non-existent field 'pos'.
Error in ACModel>slider4_Callback (line 261) pos = cellfun(@(x) {x-[0 get(handles.slider4,'value') 0 0]},handles.pos);
Error in gui_mainfcn (line 96) feval(varargin{:});
Error in ACModel (line 42) gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)ACModel('slider4_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
David Sanchez
David Sanchez 2013 年 6 月 12 日
Did you run the example at the bottom of the link? You can work on top of it, including modifications one at a time and checking it still works. You have to many errors in your code ( it seems it is quiet long ). The scrollbar GUI is a bit complicated as to explain it in here. I think the example on the link is a good starting point.

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

その他の回答 (0 件)

カテゴリ

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