Use tags in gtktextview

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all:
I try to use Gtktags to change fonts in a gtktextview.
Here is my code:

textview1 = gtk_text_view_new ();
gtk_widget_set_name (textview1, "textview1");
gtk_text_buffer_set_text (gtk_text_view_get_buffer
(GTK_TEXT_VIEW (textview1)), _("some text"), -1);
  
text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW
(textview1));
tag = gtk_text_buffer_create_tag(text_buffer,
"myprop", /* "size", 16,*/ "weight",
PANGO_WEIGHT_BOLD, NULL);
  
gtk_text_buffer_get_start_iter(text_buffer, 
&start_iter);
gtk_text_buffer_get_start_iter(text_buffer, 
&end_iter);
gtk_text_buffer_apply_tag(text_buffer, tag,
&start_iter, &end_iter);
gtk_widget_show (textview1);

I find both the "size" and the "weight" property does
not effect on the text.
Is there any mistakes? 
Thanks.


		
___________________________________________________________ 
雅虎免费G邮箱-No.1的防毒防垃圾超大邮箱 
http://cn.mail.yahoo.com/?id=77072
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux