Multi-colored pop-up menu entries

4 views (last 30 days)
Matt J
Matt J on 11 Jun 2013
Is there a way to make a gui pop-up menu display its list of selections with different text colors? What about different fonts and typesetting (Italics, Boldface, etc...)

Accepted Answer

Hugo
Hugo on 11 Jun 2013
Yes, try this:
uicontrol('style','popup','string',{'<FONT COLOR="red" SIZE="10" FACE="ARIAL">*_Here_*','<FONT COLOR="blue" SIZE="4" FACE="Courier">*There*','<FONT COLOR="maroon" SIZE="6" FACE="GEORGIA">Anywhere'})
Basically, I'm just using HTML. Take a look at each element in the cell of strings. Here is the first one.
'<FONT COLOR="red" SIZE="10" FACE="ARIAL">*_Here_*'
There are many ways you can format text in HTML. You can find that in google, but if you have no idea at all, you can start by taking a look at http://www.tizag.com/htmlT/font.php and then try to find other more complete tutorials if you need so.
Hope this helps. Best regards

More Answers (0)

Categories

Find more on Environment and Settings 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!