diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-11-23 23:16:22 -0500 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2010-12-04 15:39:42 +0100 |
commit | 0f98b1509075b56d9742a3df4c32f8c453342da0 (patch) | |
tree | 93a03116d3c52ef6dcff8b00b0f09aca2db8fc2c /tests/styleexamples.c | |
parent | 3ddee2561b031272f58100025d90e64c7c4483da (diff) | |
download | gtk+-0f98b1509075b56d9742a3df4c32f8c453342da0.tar.gz |
Add illustration to gtk_render_handle docs
Diffstat (limited to 'tests/styleexamples.c')
-rw-r--r-- | tests/styleexamples.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/styleexamples.c b/tests/styleexamples.c index b20c7e4eea..75350ddd2d 100644 --- a/tests/styleexamples.c +++ b/tests/styleexamples.c @@ -297,6 +297,31 @@ draw_cb_frame_gap (GtkWidget *widget, cairo_t *cr) return TRUE; } +static gboolean +draw_cb_handles (GtkWidget *widget, cairo_t *cr) +{ + GtkStyleContext *context; + + context = gtk_widget_get_style_context (widget); + gtk_style_context_save (context); + + gtk_style_context_add_class (context, "paned"); + gtk_render_handle (context, cr, 12, 22, 20, 10); + gtk_render_handle (context, cr, 44, 12, 10, 20); + gtk_style_context_remove_class (context, "paned"); + + gtk_style_context_add_class (context, "grip"); + gtk_style_context_set_junction_sides (context, GTK_JUNCTION_CORNER_BOTTOMLEFT); + gtk_render_handle (context, cr, 12, 48, 12, 12); + + gtk_style_context_set_junction_sides (context, GTK_JUNCTION_CORNER_BOTTOMRIGHT); + gtk_render_handle (context, cr, 40, 48, 12, 12); + + gtk_style_context_restore (context); + + return TRUE; +} + static char *what; static gboolean @@ -324,6 +349,8 @@ draw_cb (GtkWidget *widget, cairo_t *cr) return draw_cb_extension (widget, cr); else if (strcmp (what, "frame-gap") == 0) return draw_cb_frame_gap (widget, cr); + else if (strcmp (what, "handle") == 0) + return draw_cb_handles (widget, cr); return FALSE; } |