Using RichTextCtrl for source code editing

Wildemar Wildenburger wildemar at freakmail.de
Sun Sep 2 10:18:19 PDT 2007


Hey there :)

I'm looking into creating a emacs-like TextCtrl for general purpose but 
"sourcecode-style" text editing. What I mean by emacs-like is that I 
want it to be infinitely versatile as to display text at different 
colors, sizes, maybe even fonts. Ideally I'd like to be able to insert 
arbitrary wx-widgets into the text but as it seems, thats currently 
impossible. What I don't want to lose though, is the ability to insert 
images into the buffer, so I'm thinking of using wx.RichTextCtrl (One of 
the things I plan to do with it is write latex code with preview-latex 
<URL:http://www.gnu.org/software/auctex/preview-latex.html>).

I know that for source-code style editing one is supposed to use STC but 
I don't see that it does the image handling. But just so I don't waste 
my time on an impossible endeavor: What obstacles would I have to 
overcome to use RichTextCtrl in the way I described (hopefully 
thoroughly enough)? I think indentation isn't a big problem, 
bracket-matching seems a bit tricky but entirely possible, colorizing a 
challange but a manageable. Well any thoughts are welcome.

/W




More information about the wxpython-users mailing list