small bug with gtk-styles

Derek Atkins warlord@MIT.EDU
15 Oct 2002 20:21:38 -0400


Applied

-derek

Christian Krause <chkr@plauener.de> writes:

> Hi,
> 
> I found a bug in src/gnome-utils/dialog-utils.c: gnc_set_label_color(..).
> 
> I noticed, that even if I set the correct locale via LANG=... all text
> is displayed correctly (EUR-Signs, ...) except the information _under_ the
> icon bar ("Net Assets"). I tracked down the problem to
> gnc_set_label_color, where you do a
> - gtk_widget_get_style to get a style
> - modify the style with setting a new color
> - gtk_widget_set_style
> I commented out all lines except the get_style and set_style, but the
> text was always in the incorrect locale. When I commented out _all_
> lines, the locale was displayed correct.
> 
> So the problem must be in getting and setting the style.
> I inserted a "gtk_widget_ensure_style(GTK_WIDGET(label));" before
> getting the style, and the problem gone away.
> 
> It seems, that in some circumstances the style isn't already set correctly
> before calling gtk_widget_get_style, so this little patch is necessary:
> -------------------------------------------------------------------------
> diff -u -r1.8 dialog-utils.c
> --- src/gnome-utils/dialog-utils.c      6 Oct 2002 09:41:50 -0000       1.8
> +++ src/gnome-utils/dialog-utils.c      11 Oct 2002 13:28:15 -0000
> @@ -381,6 +381,7 @@
>      return;
>  
>    cm = gtk_widget_get_colormap(GTK_WIDGET(label));
> +  gtk_widget_ensure_style(GTK_WIDGET(label));
>    style = gtk_widget_get_style(GTK_WIDGET(label));
>  
>    style = gtk_style_copy(style);
> -------------------------------------------------------------------------
> 
> regards,
> christian
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel@lists.gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available