I use DEVHELP ver 3.4.1 on Fedora 17.
Found a bug.
Open GTK+3 Reference Manual > Theming in GTK+ > GtkStyleContext
> scroll down to paragraph DESCRIPTION > paragraph TRANSITION ANIMATIONS
there is Example 9. Using enumeration to identify animatable regions
Code:
enum {
REGION_ENTRY,
REGION_BUTTON_UP,
REGION_BUTTON_DOWN
};
...
gboolean
spin_button_draw (GtkWidget *widget,
cairo_t *cr)
{
GtkStyleContext *context;
context = gtk_widget_get_style_context (widget);
gtk_style_context_push_animatable_region (context,
GUINT_TO_POINTER (REGION_ENTRY));
gtk_render_background (cr, 0, 0, 100, 30);
gtk_render_frame (cr, 0, 0, 100, 30);
gtk_style_context_pop_animatable_region (context);
...
}
first of all
gtk_render_background (cr, 0, 0, 100, 30);
gtk_render_frame (cr, 0, 0, 100, 30);
should be
gtk_render_background (context, cr, 0, 0, 100, 30);
gtk_render_frame (context, cr, 0, 0, 100, 30);
but it is only part of problem. there is much worse:
if you try this:
Code:
GList *m_list = gtk_style_context_list_regions(context);
you will get NULL pointer - there are NO regions for spin button ?!
is it BUG or what ?!