GNOME Bugzilla – Bug 346751
symbolic colors can't be use in properties
Last modified: 2011-02-04 16:10:42 UTC
Symbolic colors can't be used in properties, for instance, in a gtkrc file : " GtkTreeView::odd_row_color = @mycolor " The following testcase (it is an improved version of the one from bug #346668) shows this problem.
Created attachment 68465 [details] testcase
Created attachment 68466 [details] correct testcase sorry, I uploaded the wrong testcase, this one is ok.
Created attachment 68468 [details] working testcase ok, this time, testcase compiles. Sorry for the wrong uploads..
Created attachment 69252 [details] [review] Patch that should fix the bug
Created attachment 69257 [details] [review] Next try
Created attachment 69258 [details] [review] Grrr
grrr patch works fine :)
Mitch, do you want to commit the grrr patch ?
Fixed in CVS: 2006-07-21 Michael Natterer <mitch@imendio.com> Enable symbolic colors and color expressions in style properties. Fixes bug #346751. * gtk/gtkrc.c (rc_parse_token_or_compound): add GtkRcStyle parameter and replace symbolic colors by color constants. (gtk_rc_parse_assignment): likewise. Also support parsing of expressions of the form identifier(compound). (gtk_rc_parse_style): pass the GtkRcStyle to gtk_rc_parse_assignment(). (gtk_rc_parse_statement): pass NULL since we don't have a GtkRcStyle here.
reopening, I'm seeing some regressions with gtk 2.10.1 final : Gtk-Message: /usr/share/themes/Ia Ora Blue/gtk-2.0/gtkrc:67: failed to retrieve property 'GtkTreeView:even-row-color' of type 'GdkColor' from rc file value "((GString*) 0x8215370)" of type "GString" interesting lines in gtkrc being : color["white"]= "#FFFFFF" #2 color["gray2"]= "#CFD7DF" #5 GtkTreeView::odd-row-color = @gray1 GtkTreeView::even-row-color = @white
Is it relevant that the color is named gray1 at the one place, and gray2 at the other ?
mmy quick testing with style "treeview" { color["white"]= "red" color["gray1"]= "blue" GtkTreeView::odd-row-color = @gray1 GtkTreeView::even-row-color = @white } class "GtkTreeView" style "treeview" worked fine. So I'm assuming this is fixed in cvs.
strange, I've tested with your gtkrc file and I'm still getting the same error with gtk+ 2.10.2 backtrace when running gtk-demo with breakpoint on g_log : Breakpoint 1, IA__g_log (log_domain=0xb7df5001 "Gtk", log_level=G_LOG_LEVEL_MESSAGE, format=0xb7e87e84 "%s: failed to retrieve property `%s::%s' of type `%s' from rc file value \"%s\" of type `%s'") at gmessages.c:513 513 { (gdb) bt
+ Trace 70661
The gtkrc snippet from Matthias works just fine here. You are probably linking against some old gtk version. Can you check this please?
ok, I just found what was causing the bug to appear : locale ;) using LC_ALL=fr_FR, I get the error, using LC_ALL=C, I don't..
I see what's going wrong. Will be fixed in CVS today. Thanks for the locale hint :)
Fixed in cvs (HEAD and 2.10): 2006-09-04 Michael Natterer <mitch@imendio.com> * gtk/gtkrc.c (rc_parse_token_or_compound) (gtk_rc_parse_assignment): serialize floating point values using locale-independent functions. (#346751, Frederic Crozat)