1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 |
static gboolean
gtk_spin_button_draw (GtkSpinButton *spin,
cairo_t *cr)
{
GtkStyleContext *context;
...
context = gtk_widget_get_style_context (GTK_WIDGET (spin));
gtk_style_context_save (context);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_ENTRY);
/* Call to entry draw impl with "entry" class */
parent_class->draw (spin, cr);
gtk_style_context_restore (context);
gtk_style_context_save (context);
/* Render up/down buttons with the "button" class */
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BUTTON);
draw_up_button (spin, cr);
draw_down_button (spin, cr);
gtk_style_context_restore (context);
...
} |