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

In reply to Re: How do i color font in a listbox? by zentara
in thread How do i color font in a listbox? (Solved!!!) by james28909

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.