To copy a style, use the style's copy() method. THen using get_style()
and set_style() you should be able to modify styles as much as you want.
I don't have a python example of this, but there is an example of doing
this in my gnorpm package (specifically the checksig.c file).
James.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
On Thu, 3 Jun 1999, J.W. Bizzaro wrote:
> Some of the style-setting functions of gtk are in pygtk, such as
>
> widget.set_style(stylename).fg[STATE_NORMAL] = (1, 0, 0)
> widget.get_style().fg[STATE_NORMAL]
>
> But the problem is with "stylename".
>
> set_style expects a GdkStyle type to be passed, but how do we get that?
>
> Gtk has these 4 functions:
>
> gtk_widget_get_default_style ()
> gtk_style_copy (stylename)
> gtk_widget_push_style (stylename)
> gtk_widget_pop_style (stylename)
>
> which don't seem to be included in pygtk.
>
> What am I to do? I want to switch styles on the fly. I am using a style rc
> file, as is used with the example testgtk. But I need to switch between them
> during runtime or be able to change parts of the default style at the very
> least.
>
>
> :-)
> Jeff
> --
> J.W. Bizzaro mailto:[EMAIL PROTECTED]
> Boston College Chemistry http://www.uml.edu/Dept/Chem/Bizzaro/
> --
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
>
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]