Hi, First of all sorry for my bad english .
I would like to know how I can color text entered in a GtkTextView (in real time), let me explain. first when the user enter text it is displayed normally, then if my lexer recognize the text, I want to be able to color it, I have the lexer, the problem is with the coloring. This is what I have done as a start in coloring fonts but it doesn't work. Can someone please tell me what am I missing. thank you */-------------------------------------------------------------------------- GtkTextView (color) -------------------------------------------------------------------------- */ #include <gtk/gtk.h> int main (int argc, char **argv) { GtkWidget *p_fenetre = NULL; GtkWidget *p_zone_texte = NULL; GtkTextBuffer *p_tampon = NULL; GtkTextIter start; GtkTextIter end; gtk_init (&argc, &argv); p_fenetre = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (p_fenetre), 320, 200); p_zone_texte = gtk_text_view_new (); p_tampon = gtk_text_view_get_buffer (GTK_TEXT_VIEW (p_zone_texte)); gtk_container_add (GTK_CONTAINER (p_fenetre), p_zone_texte); gtk_text_buffer_create_tag (p_tampon, "font-blue", "foreground", "blue", NULL); gtk_text_buffer_get_bounds (p_tampon, &start, &end); gtk_text_buffer_apply_tag_by_name (p_tampon, "font-blue", &start, &end); gtk_widget_show_all (p_fenetre); g_signal_connect (G_OBJECT (p_fenetre), "delete_event", G_CALLBACK (gtk_main_quit), NULL); /* Boucle */ gtk_main (); return 0; } -- View this message in context: http://www.nabble.com/gtk-and-color-in-a-GtkTextview-tp14497051p14497051.html Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com. _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list