user2229472
user2229472

Reputation: 509

Wxpython : How to add new lexer to StyledTextCtrl?

I wrote my own lexer

I want to add my own new lexer to StyledTextCtrl in wxpython? I am currently operating on Windows

Upvotes: 0

Views: 805

Answers (1)

Mike Driscoll
Mike Driscoll

Reputation: 33071

You'll probably have to subclass the control and override the SetupBaseStyles where you'll have to use the StyleSetSpec to specify your lexer's settings. Here is a link that walks you through a lot of the process:

http://packtlib.packtpub.com/library/9781849511780/ch04lvl1sec05

And here's the official wxPython wiki page on the subject:

http://wiki.wxpython.org/StyledTextCtrl%20Lexer%20Quick%20Reference

Finally, here's a link to a short example:

http://nullege.com/codes/search/wx.stc.StyledTextCtrl.SetLexer

Upvotes: 1

Related Questions