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
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.
Lorenzo Ciampolini
Lorenzo Ciampolini 2017-5-31
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.

请先登录,再进行评论。

采纳的回答

Yair Altman
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):
  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 个评论
Lorenzo Ciampolini
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... :-)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by