Archive

Posts Tagged ‘gtksourceview’

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

8 October 2008 Leave a comment
#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: , , ,