[maemo-users] [maemo-users] Re: ?OT: Cant set background color w/py2.5 glade notebook widget on 770

From: Danny Milosavljevic danny_milo at yahoo.com
Date: Tue Feb 13 21:08:12 EET 2007

On Mon, 12 Feb 2007 18:36:23 -0500, Jeff G wrote:
> I can't seem to set the background color of a label widget in a
> notebook widget (not the page identifier)
> window1
>    vbox1
>      notebook1
> I'm trying to make the entire notebook have a background color.
> setting window1 background works directly on linux
>     window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('#4A85DD'))
> on scratchbox had to add similar line for notebook1
>     nbook.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('#4A85DD'))
> but can't seem to do it under the 770 implementation

Err. I hope you only wrote "modify_bg" as a simplification and don't actually have that in code. Colors are a theme issue.

If you just want to make the user able to recolor your widget, give it a name(gtk_widget_set_name("foobar")).

Then as user / theme author in "~/.gtkrc-2.0" / your theme do:

style "foo" {
	bg[NORMAL] = { 0.5, 0.5, 0.7 }
	base[NORMAL] = { 0.0, 0.0, 0.0 }

widget "foobar" style "foo"

If, on the other hand, you draw your own widget:

This also makes it a lot easier to test when what change works where :-)

> if this is way off topic, sorry, and please redirect me to proper list.

Seems on-topic to me, however I don't have an answer to your particular question. Maybe create an eventbox, theme that and add your notebook in it? Should be able to find out by hacking a bit...


More information about the maemo-users mailing list