I'm trying to implement syntax highlighting in my text widget. Here is my code:
static void create_tags(GtkTextBuffer *buffer) { gtk_text_buffer_create_tag(buffer, "doctype", "background", "grey", "editable", FALSE, NULL); } static void text_changed(GtkTextBuffer *buffer, gpointer data) { changed = 1; GtkTextIter start; GtkTextIter end; gtk_text_buffer_get_iter_at_offset(buffer, &start, 0); gtk_text_buffer_get_iter_at_offset(buffer, &end, -1); gtk_text_buffer_remove_all_tags(buffer, &start, &end); gtk_text_buffer_get_iter_at_line_offset(buffer, &start, 0, 0); gtk_text_buffer_get_iter_at_line_offset(buffer, &end, 1, 0); gtk_text_buffer_apply_tag_by_name(buffer, "doctype", &start, &end); } The text_changed function is connected to the "changed" signal of the buffer, and i can apply the tag fine, but when I start the application I get this error: (application.exe:2792): GtkWarning **: Unknown tag 'doctype' It doesn't seem to have any affect so right now I'm just letting sleeping dogs lie, but does anyone know what's wrong?
_______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list