in reply to How do i color font in a listbox? (Solved!!!)

You my friend, are about to be introduced to the wonderful world of css in conventional apps.

As one of the benefits to using of the newer toolkits, and since Wx is usually built on Gtk+ libs, you now get to wrack-your brain trying to figure out how to override the internal themeing engine, and it isn't a cake-walk. Now, in Tk all you need to do is set a -fg option or a -bg option for the inserts. But in the newer toolkits, like Wx, you will need to find out how to override the default theme, either in the .gtk2rc or .config/gtk3 files.

The solution all depends on which version of Wx that you have going. Are you using one based on Gtk2 or Gtk3? In the latest, you will need to setup a Gtk3::CssProvider->new; ; which of course is named something different (but similar) in Wx.

This will allow you to override a theme, so google for Wx CSSProvider and hope you find a solution.

If you want an easier solution, IMHO, rather than jump thru hoops to get custom colors in a listbox, why not put your data into a Text Widget, which lets you tag inserts with colors.


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^2: How do i color font in a listbox?
by Anonymous Monk on Jul 11, 2014 at 10:30 UTC
      I can't believe how complicated this all has become. I'm glad to hear WxWidgets is making progress toward making setting a bg and fg color easier.

      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku ................... flash japh