Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Login



GtkSourceView is a widget that is not actually a part of the GTK+ libraries. It is an external library used to extend the Gtk::TextView widget. There is a large list of features that GtkSourceView widget adds to the text view. A list of the most notable ones follows:

  • Line numbering.
  • Syntax highlighting for many programming languages.
  • Automatic indentation.
  • Bracket matching.
  • Undo/Redo support.
  • Source markers for for denoting locations in the source code.
  • Highlighting the current line.

If you ever used GEdit you wil recognize the following image, where you can see a sample GtkSourceView widget


The GtkSourceView library has a whole separate API documentation, which can be viewed at the If you would like to make this library available to Ruby GTK+, you'd have to compile the library yourself and write Ruby interface for it. To compile an application that uses this library, you need to add `pkg-config --cflags --libs gtksourceview-1.0` to the compile command.

Last modified:2012/09/09 02:15:00
References:[tut-gtk2-txtw] [tut-gtk]