Is there an hidden status for popup menus?

2 views (last 30 days)
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
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.
Lorenzo Ciampolini
Lorenzo Ciampolini on 31 May 2017
Hi, No I am programming by hands and not using GUIDE.
This is the GUI after I preselect the value ('28lp' in this case):
Then immediately after user input, selecting '28lp' from the scroll list:
And finally when user turns to another popup:
My GUI works fine, I was just wondering how to change the background... And also a bit puzzled by this behavior.

Sign in to comment.

Accepted Answer

Yair Altman
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):
  1. http://undocumentedmatlab.com/blog/customizing-menu-items-part-1
  2. http://undocumentedmatlab.com/blog/customizing-menu-items-part-2
  3. http://undocumentedmatlab.com/blog/customizing-menu-items-part-3
  4. 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
  1 Comment
Lorenzo Ciampolini
Lorenzo Ciampolini on 9 Jun 2017
Thanks a lot for this links. Looks I had a correct feeling about 'hidden' properties. If I need it, I will dig into this doc... :-)

Sign in to comment.

More Answers (0)

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!