summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2000-11-14 01:08:28 +0000
committerHavoc Pennington <hp@src.gnome.org>2000-11-14 01:08:28 +0000
commit73a00eeb447d40a6ed53ac57c482e4d1cb9483f3 (patch)
tree2b047070821790df0a34f712590ece91a64a14b3 /demos
parentf15049bd0241241c6865d9405a331ef1694ace56 (diff)
downloadgtk+-73a00eeb447d40a6ed53ac57c482e4d1cb9483f3.tar.gz
fix bug where GC didn't always get updated properly
2000-11-13 Havoc Pennington <hp@redhat.com> * gtk/gtktextdisplay.c (gtk_text_render_state_update): fix bug where GC didn't always get updated properly * demos/gtk-demo/textview.c (create_tags): Use subattributes of fonts instead of setting the entire font * gtk/testtext.c (fill_example_buffer): Use "size" instead of setting entire font * gtk/gtkdialog.c (gtk_dialog_add_button): Fix some warnings * gtk/gtktexttag.h, gtk/gtktexttag.c: Explode font_desc into a bunch of individually-settable font attributes. You can still use the "font" and "font_desc" args, they just set all the font attributes at once.
Diffstat (limited to 'demos')
-rw-r--r--demos/gtk-demo/textview.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/demos/gtk-demo/textview.c b/demos/gtk-demo/textview.c
index d6ee7b4254..72c9b7e048 100644
--- a/demos/gtk-demo/textview.c
+++ b/demos/gtk-demo/textview.c
@@ -71,13 +71,14 @@ create_tags (GtkTextBuffer *buffer)
*/
tag = gtk_text_buffer_create_tag (buffer, "italic");
- g_object_set (G_OBJECT (tag), "font", "sans italic", NULL);
+ g_object_set (G_OBJECT (tag), "style", PANGO_STYLE_ITALIC, NULL);
tag = gtk_text_buffer_create_tag (buffer, "bold");
- g_object_set (G_OBJECT (tag), "font", "sans bold", NULL);
+ g_object_set (G_OBJECT (tag), "weight", PANGO_WEIGHT_BOLD, NULL);
tag = gtk_text_buffer_create_tag (buffer, "big");
- g_object_set (G_OBJECT (tag), "font", "sans 120", NULL);
+ /* 70 points times the PANGO_SCALE factor */
+ g_object_set (G_OBJECT (tag), "size", 70 * PANGO_SCALE, NULL);
tag = gtk_text_buffer_create_tag (buffer, "blue_foreground");
g_object_set (G_OBJECT (tag), "foreground", "blue", NULL);
@@ -141,13 +142,13 @@ create_tags (GtkTextBuffer *buffer)
tag = gtk_text_buffer_create_tag (buffer, "superscript");
g_object_set (G_OBJECT (tag),
"offset", 10,
- "font", "Sans 8",
+ "size", 8 * PANGO_SCALE,
NULL);
tag = gtk_text_buffer_create_tag (buffer, "subscript");
g_object_set (G_OBJECT (tag),
"offset", -10,
- "font", "Sans 8",
+ "size", 8 * PANGO_SCALE,
NULL);
}