On Mon, 2002-07-01 at 15:34, Jacek Pliszka wrote:
> On 1 Jul 2002, Graham Ashton wrote:
> 
> > http://www.moeraki.com/pygtktutorial/ch-settingwidgetattributes.html#WIDGET_STYLES
> 
> Aaaa.. I have to apply it to the label! I must say this thing really 
> sucks.
> 
> 1. I have to add event_box
> 
> 2. I have to change color in 3!!! places. Much too much coding for such
> a simple thing.
> 
> No surprise the whole GNOME is so bloated and slow, much slower than good 
> old fvwm2.

You have to use it right... Assign a name to the widget for which you
want to change the color. Then use that name in a "custom" stylesheet to
change the color. You can do that inline (as shown below) or in a
seperate rc file which can be parsed by gtk.rc_parse(filename).


import gtk

gtk.rc_parse_string('''
        style "mystyle" {
                bg[NORMAL] = "#00FF00"
        }
        widget "*.mybutton" style "mystyle"
''')

win = gtk.Window()
button = gtk.Button('text')

button.set_name('mybutton')

win.add(button)
win.show_all()

gtk.main()

Regards,

Arjan




_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to