[wxPython-users] wxStyledTextCtrl questions
Robin Dunn
robin at alldunn.com
Sun Mar 4 16:25:04 PST 2007
kib wrote:
> Hi,
>
> I'm looking for a simple sample of highlighting one's language with the
> wxStyledTextCtrl. Even if the language syntax is trivial, ie highlight only the
> numbers and some directives inside the current document.
Basically all that is required is to set the lexer to STC_LEX_CONTAINER,
and then respond to the EVT_STC_STYLENEEDED event where you need to set
the styling info up to the position specified in the event object. I
don't have any good examples of this, but be sure to read the Scintialla
docs to get a better idea of how the underlying code works. Translating
that to wxSTC and Python shouldn't be too hard.
http://scintilla.sourceforge.net/ScintillaDoc.html
>
> One more thing : I saw that the character "§" takes 2 colums when I make my stc
> show the current cursor position, is that a bug ?
The STC stores the document data internally as utf-8 so what you are
seeing as column offsets is actually related to character positions in
this buffer where some characters can occupy more than one byte.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list