Home > Uncategorized > up-to-date sample code for gtksourceview2 (from the svn)

up-to-date sample code for gtksourceview2 (from the svn)

#CREDITS
#http://www.progbox.co.uk/wordpress/?p=300
#DEPENDS: gtksourceview2 and libxml2
import gtk
import gtksourceview2
win = gtk.Window()
bufferS = gtksourceview2.Buffer()
manager = gtksourceview2.LanguageManager()
language = manager.get_language("xml")
#langS.set_mime_types(["text/x-python"])
bufferS.set_language(language)
bufferS.set_highlight_syntax(True)
view = gtksourceview2.View(bufferS)
view.set_show_line_numbers(True)
win.resize(400,400)
win.add(view)
win.show_all()
gtk.main()
Categories: Uncategorized Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: