Question

I'm trying to figure out if it's possible to style the items in a drop-down menu when I use the wxChoice widget. Best I can tell, it's not possible but I just wanted to ask the greater Perl community to make 100% sure that I was correct in my thinking.

My goal would be to color some of the items in the pull-down red, while others were black. I noticed that the wxChoice widget has the method SetForegroundColour, but this colors all the text in the wxChoice widget.

$driveCB->SetForegroundColour(wxRED);

Results in a pull-down looking like this:

wxChoice example using SetForegroundColour

Is it possible to individually style wxChoice items?

Was it helpful?

Solution

You can't do it with a wxChoice, but you could use a wxOwnerDrawnComboBox, there is an example of it in the wxWidgets samples, in the folder called combo.

OTHER TIPS

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top