GtkScintilla is a GTK+ widget which enables easily adding a powerful source code editor to your applications. Harnessing the abilities of the Scintilla editing component, GtkScintilla adds a familiar GTK+/GObject API, making the widget comfortable to use in these programs, using all the typical GObject conventions.
Some of the current and future features (beyond those of Scintilla itself) include:
Screenshot of GtkScintilla in Glade 3.
This is the simplest possible use of GtkScintilla:
#include <gtk/gtk.h> #include <gtkscintilla.h> int main(int argc, char *argv[]) { GtkWidget *win, *sci; gtk_init(&argc, &argv); win = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(GTK_WINDOW(win), 640, 480); gtk_window_set_title(GTK_WINDOW(win), "GtkScintilla Basic Demo"); g_signal_connect(win, "destroy", gtk_main_quit, NULL); sci = gtk_scintilla_new(); g_object_set(G_OBJECT(sci), "text", "Hello World", NULL); gtk_container_add(GTK_CONTAINER(win), sci); gtk_widget_show_all(win); gtk_main(); return 0; }
Compile with:
gcc `pkg-config --cflags --libs gtk+-2.0 gtkscintilla-1.0` demo.c
GTK+ is a highly usable, feature rich toolkit for creating graphical user interfaces which boasts cross platform compatibility and an easy to use API.
$ ./autogen.sh $ ./configure $ make $ make install
GNU Lesser General Public License v3.0
Matthew Brush <matthewbrush(at)gmail(dot)com>
You can download this project in either zip or tar formats.
You can also clone the project with Git by running:
$ git clone git://github.com/codebrainz/GtkScintilla
This is what GtkScintilla is based off of, though it is quite different now.
More related to the GNOME project, this widget is used in Gedit for example.
You can use the Scintilla GTK+ widget directly if you prefer its interface.