views:

185

answers:

1

I'm using wxStyledTextCtrl from wxPython, a wrapper around the Scintilla component.

Is there any way to get alternate row coloring on it (odd rows in one background color and even rows in another color)? I'm using the builtin python styler to highlight keywords.

+2  A: 

The background of lines can be changed, for example by markers (which is used for stuff like bookmarks or breakpoints, current execution point and the like in IDEs), but there is no built-in mode for changing the background colour of every other line.

You could simulate this by setting a special marker with a background colour for all odd or even line numbers (MarkerSetBackground() and MarkerAdd()). This would probably consume a lot of cycles, and each editing operation that splits or joins, inserts or deletes lines would need the markers to be reset. Still, it may be worth looking into, given that there seems to be no other way.

mghie
@mghie: I'll take a look, thanks
PabloG