Search code examples
cgtkgedit

How to get GTK syntax highlighting in GEdit?


I just started using GTK to develop my GUI applications. I'm using GEdit as my text-editor, so how can I get the following to be included in the syntax highlighting:

GtkWidget *window;
GtkWidget *button
GtkWidget *box1;

gtk_init(&argc, &argv);

as if it were like this:

int x = 3;

Solution

  • You can extend Gedit's syntax with a .lang file which contains XML:
    http://library.gnome.org/devel/gtksourceview-2.0/stable/lang-tutorial.html
    http://library.gnome.org/devel/gtksourceview-2.0/stable/lang-reference.html

    So you could change your C language file to add GTK+ data types. It wouldn't surprise me that someone already wrote it, though.