Search code examples
wxpythonwxwidgetswxperl

Is it possible to change the colour of the "focus selector" of a ListCtrl?


In Mozilla Thunderbird mail you can assing items in a list a colour. The "focus selector" usually has the "cursor colour" that is defined by the window theme on your OS. Now, when you select a coloured item in Thunderbird, the focus cursor changes colour accordingly. That is to indicate that this item has a colour. Otherwise the user could only see that this particular item has a colour by moving away the "focus selector".

Now, is this possible in WxWindows, a WxListCtrl? Apart from changing the font-colour (SetForegroundColour) and the item's background (SetbackgroundColour, which is usually white)?

"Focus selector" set on the first entry in a two item list ListCtrl


Solution

  • The wxPython toolkit wraps the native widget of the OS as much as possible. I don't believe any native widgets support custom colors for the "cursor color". You might want to take a look at the UltimateListCtrl. I'm not sure if that has this feature out of the box, but it is a pure Python list control and I'm sure you could patch it much more easily to add that functionality.