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!