Open text dialog with checkbox
조회 수: 7 (최근 30일)
이전 댓글 표시
Hello Guys,
I am building a GUI with different functions in which I have an "Info" checkbox. When this box is checked, I programmed a uicontrol with some text in it which deems as information or help to the gui. When the checkbox is unchecked, the dialog box with the text is closed.
My question: How can I make this dialog box with the text to appear right next to the opened GUI, irrespective of where it is placed on the screen. It should always appear at the top right corner of the GUI (I have my checkbox also in this region). I tried to access the position of the GUI but the scaling seems to be different with different figures. Could someone please help me!!
Thanks, Advait
댓글 수: 0
답변 (2개)
Robert Cumming
2014년 7월 30일
편집: Robert Cumming
2014년 7월 30일
position and units are the 2 properties you want to look at.
Specific help wont be possible unless you give specific problem (i.e. code and example of when your dialog box position is not in the correct position.
Edit: based on your example code your problem is not the position but the fact the new dialog doesn't close when you uncheck the checkbox.
In the else section you need to delete (or set to invisible) the dialog you created. You need access to the figure handle to do that. Some ideas to get you going:
store the fig handle in handles data
store as a persistent variable in your callback.
store the handle in your user data of the checkbox
alternate your checkbox callback depending on the value
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!