You can change the default attributes for a given #GtkTextView, and you can
apply tags that change the attributes for a region of text. For text features
that come from the theme — such as font and foreground color — use
-standard #GtkWidget functions such as gtk_widget_modify_font() or
-gtk_widget_modify_text(). For other attributes there are dedicated methods on
+standard #GtkWidget functions such as gtk_widget_modify_font() or
+gtk_widget_override_text(). For other attributes there are dedicated methods on
#GtkTextView such as gtk_text_view_set_tabs().
<informalexample><programlisting>
GtkTextBuffer *buffer;
GtkTextIter start, end;
PangoFontDescription *font_desc;
- GdkColor color;
+ GdkRGBA rgba;
GtkTextTag *tag;
view = gtk_text_view_new (<!-- -->);
pango_font_description_free (font_desc);
/* Change default color throughout the widget */
- gdk_color_parse ("green", &color);
- gtk_widget_modify_text (view, GTK_STATE_NORMAL, &color);
+ gdk_rgba_parse ("green", &rgba);
+ gtk_widget_override_color (view, GTK_STATE_FLAG_NORMAL, &rgba);
/* Change left margin throughout the widget */
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 30);