Reputation: 96827
Are there any easy to use python components that could be used in a GUI? It would be great to have something like JSyntaxPane for Python. I would like to know of python-only versions ( not interested in jython ) .
Upvotes: 1
Views: 544
Reputation: 800
You say "in a GUI app" but don't mention the toolkit.
If you are using PyQt, and need a read-only widget, you can use QWebKit which has a whole HTML widget in it based on WebKit, so it supports pretty much anything, from flash to the ACID2 test.
If you want a read-write widget, Qt's QTextEdit supports syntax highlighting, and I wrote an adapter to let pygments worj with it:
http://lateral.netmanagers.com.ar/weblog/2009/09/21.html#BB831
I am sure something similar can be done with other toolkits, but I don't know how.
Upvotes: 0
Reputation: 7512
You can use StyledTextCtrl in wxPython. Check out the official demo for an example (The demo code tab for any demo).
Upvotes: 1
Reputation: 198577
If you're using gtk+, there's a binding of gtksourceview for Python in gnome-python-extras. It seems to work well in my experience. The downside: the documentation is less than perfect.
There's also a binding of QScintilla for Python if PyQt is your thing.
Upvotes: 1