Re: Setting widget styles

2008-08-10 Thread Stefan Kost

Tony Houghton schrieb:

I want to change the cursor/caret aspect ratio for a widget on the fly.
The docs say you should first call gtk_widget_get_modifier_style(),
make your modifications to the returned style, then call
gtk_widget_modify_style() with that style. The trouble is I can't find
any way to modify a style. I must be missing something, otherwise
there's no point in having GtkRcStyle in the API at all.

As the docs refer to style properties I've tried calling
g_object_set_property(..., cursor-aspect-ratio, ...) on the GtkRcStyle
but I got an error that the property name doesn't exist or something
like that.



style-properties are not g-object properties :/ And usually they are read-only. 
It sucks because I fails to see why most apps ever would want to read them, if 
they can't modify them ...


Stefan
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Setting widget styles

2008-08-10 Thread Emmanuele Bassi
On Sun, 2008-08-10 at 14:50 +0300, Stefan Kost wrote:
 
  As the docs refer to style properties I've tried calling
  g_object_set_property(..., cursor-aspect-ratio, ...) on the GtkRcStyle
  but I got an error that the property name doesn't exist or something
  like that.
  
 
 style-properties are not g-object properties :/ And usually they are 
 read-only. 
 It sucks because I fails to see why most apps ever would want to read them, 
 if 
 they can't modify them ...

you obviously need to read them if you are implementing a widget and
you're using them to draw it following the current theme; that's the
whole point of having style properties in the first place. :-)

to answer the OP, the style properties are writable by writing a theme
for your application - either a file you ship with your application or a
string you embed in your source code.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list