controlling background color of selected uicontrol popup?
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 10 Feb 2011
Jan
il 15 Feb 2011
Does REFRESH(FigHandle) help?
Walter Roberson
il 18 Feb 2011
Risposta accettata
Più risposte (2)
Matt Fig
il 28 Gen 2011
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 Commenti
Walter Roberson
il 28 Gen 2011
Jan
il 29 Gen 2011
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
il 29 Gen 2011
Modificato: Walter Roberson
il 2 Ago 2021
Walter Roberson
il 29 Gen 2011
Walter Roberson
il 29 Gen 2011
Jan
il 29 Gen 2011
Fine. Is your problem solved then?
Daniele Scaranari
il 31 Ott 2018
0 voti
figure(gcf) works correctly in Matlab R2017a, Windows10.
Categorie
Scopri di più su File Operations in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!