Resetting a pop-up menu in a GUI
조회 수: 4 (최근 30일)
이전 댓글 표시
Hey all,
In my GUI I have a drop down menu with four options, the first (& default) option being 512. I also have a reset button, which sets everything else in the GUI back to its default options.
My problem is I'm not sure how to set a drop down menu back to its default option, in this case being the first entry in the list.
My drop down menu is tagged frame_size_2. I know the code, placed in the callback for the reset button, is something along these lines:
set(handles.frame_size_2,'Value')
But I can't work out what is supposed to go in the 'Value' part.
Any tips?
As always, thanks in advance for any help.
댓글 수: 0
채택된 답변
Sean de Wolski
2011년 12월 1일
set(handles.frame_size_2,'Value',n)
where n is the index to the line you want. And a good tip for remembering, set has three inputs, get has two.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!