Re: gtk-style-context has landed



On Tue, 2010-12-07 at 17:32 +0100, Murray Cumming wrote:
<snip>
> I'm wondering how code such as this should be ported (I'm porting a
> similar gtkmm example):
> http://git.gnome.org/browse/gtk+/tree/gtk/gtkcellrenderertoggle.c#n325
> 
> The old gtk_paint_*(GtkStyle*,) functions took a GtkStateType parameter,
> which is presumably deprecated in favour of GtkStateFlags, though that's
> not documented.

Yep. I actually went through the gtk_paint_* code to find the
equivalences between GtkStateType and GtkStateFlags.

> But the new gtk_render_*(GtkStyleContext*, ) functions don't have a
> state parameter, because GtkStyleContext has a state instead. But then
> what happens to the state logic in that code?

>From memory:
gtk_style_context_save (ctx);
gtk_style_context_set_state (ctx, your_calculated_state);
gtk_render_foobar();
gtk_style_context_restore (ctx);

This is a small example:
http://git.gnome.org/browse/totem/commit/?id=dfb7c0a3dc7a9a2c1b769bd90bd74c03ad3faeeb

> >       * Apps are encouraged to switch, I guess a GNOME goal should be
> >         set up to handle this, Javier? :)
> > 
> > I'll be handling these items during the next days, helping hands are of
> > course welcome.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]