controlling background color of selected uicontrol popup?
古いコメントを表示
I can create a uicontrol('Style','popup') with a 'backgroundcolor'. This works and the color is the one I chose. However, as soon as I select any value, the background color goes to a grayish, with the text in the foreground color I have set. The selected pop-up entry does not use the background color.
Is there a way to control the background color of a selected pop-up entry?
(I am trying to color-code my uicontrols according to the major class of functionality they have within the terms of my program. Although I could in theory do so just by adjusting their text foreground colors, the area of the text compared to the area of the control is relatively small and the color coding of the text is not nearly as distinguishable as color coding the background.)
3 件のコメント
Walter Roberson
2011 年 2 月 10 日
Jan
2011 年 2 月 15 日
Does REFRESH(FigHandle) help?
Walter Roberson
2011 年 2 月 18 日
採用された回答
その他の回答 (2 件)
Matt Fig
2011 年 1 月 28 日
Things seem to work here as you wish, unless I misunderstand you.
uicontrol('Style','popup','backgroundcol',[.9 .7 .3],'string',{'P';'Y';'F'})
This creates a popupmenu with an orange-ish bgc. After I select any of the three strings, the bgc is the same.
6 件のコメント
Walter Roberson
2011 年 1 月 28 日
Jan
2011 年 1 月 29 日
And this is exactly what my suggested method does: Disable the uicontrol temporarily, what forces a redraw. The moving of the focus is just a side-effect. Did you try my function?
Walter Roberson
2011 年 1 月 29 日
編集済み: Walter Roberson
2021 年 8 月 2 日
Walter Roberson
2011 年 1 月 29 日
Walter Roberson
2011 年 1 月 29 日
Jan
2011 年 1 月 29 日
Fine. Is your problem solved then?
Daniele Scaranari
2018 年 10 月 31 日
0 投票
figure(gcf) works correctly in Matlab R2017a, Windows10.
カテゴリ
ヘルプ センター および File Exchange で File Operations についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!