Is there an hidden status for popup menus?
2 views (last 30 days)
Show older comments
Lorenzo Ciampolini
on 31 May 2017
Commented: Lorenzo Ciampolini
on 9 Jun 2017
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 Comments
Image Analyst
on 31 May 2017
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.
Accepted Answer
Yair Altman
on 1 Jun 2017
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
More Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!