Is there an hidden status for popup menus?
1 次查看(过去 30 天)
显示 更早的评论
Hello, When I build my GUI and use a popup menu, I can initialize its value to a default value by using e.g.
set(fieldScrollH,'value',ij)
The popup shows the correct ij-th value, but with a white background, until the user interactively selects this value, i.e. by scrolling the list and selecting the value. After this user interaction, the value is displayed in gray, and the callback is called.
Now my question is : what differentiates the popupmenu BEFORE and AFTER the user interaction? If I take a look at properties, no property changes its value (supposing the user has selected the same value as the default value; otherwise the 'Value' property would change). Is there an hidden property controlling the background of the popup?
The reason why I am asking is: I have a chain of five popups and would like to offer to the user, for each popup, a default value; the user could then acknowledge with a simple "OK" button all values, unless it is needed to change one or more popups. Apparently this works even if fields are not grayed.
2 个评论
Image Analyst
2017-5-31
Are you using GUIDE? Can you post a screenshot? Why does it matter if the backgrounds were all white when the user clicked a button to accept all the shown/default items? Some of the control colors might be chosen by the operating system, like what text looks like when it's highlighted/selected, rather than MATLAB.
采纳的回答
Yair Altman
2017-6-1
This functionality is part of the underlying Java object that is used by the Matlab GUI. You can customize it at the Java level (assuming you're not using the new web-based uifigures, which use a different mechanism):
- http://undocumentedmatlab.com/blog/customizing-menu-items-part-1
- http://undocumentedmatlab.com/blog/customizing-menu-items-part-2
- http://undocumentedmatlab.com/blog/customizing-menu-items-part-3
- http://undocumentedmatlab.com/blog/modifying-matlab-look-and-feel
You'll need to dig in Java forums/books in order to see how this could be customized for your requested look-and-feel.
Yair Altman
更多回答(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!