"J.W. Bizzaro" wrote:
>
> BTW, this might have been mentioned on the gtk list, but font styles can't be
> changed without first removing the widget and then re-adding it (or so it seems
> to me).  Interestingly, this is not the case with color styles.  Can you
> verify/clarify this James?

Ah ha!  I found a way around this problem.

You might normally just call

    button = GtkButton("Click Me")

and you don't have to add a label widget.  But for some reason, calling

    rc_parse_string(...)

after the widget is made and shown, works to set the bg, but calling it to set
fg (presumably the label) DOESN'T work.  I would have thought it would.

But then I thought that maybe the call to set the button fg (the label) isn't
"reaching" the label widget, part of the button, which is actually a composite
widget.

As an alternative, you can call

    button = GtkButton()

with no label defined, and then add a label widget to the button "container":

    label = GtkLabel("Click Me")
    button.add(label)

Now if you call rc_parse_string once for the button bg, and once for the label
fg, everything is okey dokey.

Confusing.  Perhaps I'm doing something wrong or there is something wrong with
the rc_parse_string mechanism.  I saw a C example where styles are changed
within the program itself using push and pop, but I want to do this using an rc
file, so that it is easier for someone to locate and change styles.  If pygtk
had other rc file methods, we could even write to the rc file at runtime.


:-)
Jeff
-- 
J.W. Bizzaro                  mailto:[EMAIL PROTECTED]
Boston College Chemistry      http://www.uml.edu/Dept/Chem/Bizzaro/
--
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to