that works for most windows, as does modify_bg(...), but ...
""" modify_bg() only affects widgets that have an associated gtk.gdk.Window<http://www.pygtk.org/docs/pygtk/class-gdkwindow.html>. Widgets that do not have an associated window include ....<http://www.pygtk.org/docs/pygtk/class-gtkarrow.html>gtk.Arrow, gtk.Bin<http://www.pygtk.org/docs/pygtk/class-gtkbin.html>, gtk.Box <http://www.pygtk.org/docs/pygtk/class-gtkbox.html>, gtk.Button<http://www.pygtk.org/docs/pygtk/class-gtkbutton.html>, gtk.CheckButton <http://www.pygtk.org/docs/pygtk/class-gtkcheckbutton.html>, gtk.Fixed <http://www.pygtk.org/docs/pygtk/class-gtkfixed.html>, gtk.Image<http://www.pygtk.org/docs/pygtk/class-gtkimage.html>, gtk.Label <http://www.pygtk.org/docs/pygtk/class-gtklabel.html>, gtk.MenuItem <http://www.pygtk.org/docs/pygtk/class-gtkmenuitem.html>, gtk.Notebook <http://www.pygtk.org/docs/pygtk/class-gtknotebook.html>, gtk.Paned <http://www.pygtk.org/docs/pygtk/class-gtkpaned.html>, gtk.RadioButton <http://www.pygtk.org/docs/pygtk/class-gtkradiobutton.html>, gtk.Range <http://www.pygtk.org/docs/pygtk/class-gtkrange.html>, gtk.ScrolledWindow<http://www.pygtk.org/docs/pygtk/class-gtkscrolledwindow.html>, gtk.Separator <http://www.pygtk.org/docs/pygtk/class-gtkseparator.html>, gtk.Table <http://www.pygtk.org/docs/pygtk/class-gtktable.html>, gtk.Toolbar<http://www.pygtk.org/docs/pygtk/class-gtktoolbar.html>, gtk.AspectFrame <http://www.pygtk.org/docs/pygtk/class-gtkaspectframe.html>, gtk.Frame <http://www.pygtk.org/docs/pygtk/class-gtkframe.html>, gtk.VBox<http://www.pygtk.org/docs/pygtk/class-gtkvbox.html>, gtk.HBox <http://www.pygtk.org/docs/pygtk/class-gtkhbox.html>, gtk.VSeparator <http://www.pygtk.org/docs/pygtk/class-gtkvseparator.html>, gtk.HSeparator <http://www.pygtk.org/docs/pygtk/class-gtkhseparator.html>. These widgets can be added to a gtk.EventBox<http://www.pygtk.org/docs/pygtk/class-gtkeventbox.html>to overcome this limitation. """ (from pygtk reference manual) so use an event box like it says... :) and try something like this: import gtk window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.connect("destroy", gtk.mainquit) label = gtk.Label("one, two, testing...") eb = gtk.EventBox() eb.add(label) eb.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("blue")) window.add(eb) window.show_all() gtk.main() (NOTE: this code was lifted from http://eccentric.cx/misc/pygtk/pygtkfaq.html ) also check out the gtk.Widget section of the reference manual and the gtk.gdk.color_parse one as well. http://www.pygtk.org/docs/pygtk/ i think that you can also use gtk.gdk.Color(...) if you need custom colors... hope this helps felix On 6/27/07, Sylvain Saleur <[EMAIL PROTECTED]> wrote:
Hello! Thank you very much, I didn't know this FAQ... So I tried this: http://faq.pygtk.org/index.py?req=show&file=faq04.006.htp But it doesn't work! I'm probably use the wrong way... If I apply this method to my notebook, it works. But I just want to set this background to one page childs. And I can't manage to do that... The structure is : Notebook page => Frame => HBox => ScrolledWindow => VBox => Label, image and Button. I'm sorry if my question has been answered many times but I'm a beginner with pygtk and also not a good english speaker... Cheers Sylvain 2007/6/27, John Dennis <[EMAIL PROTECTED]>: > On Tue, 2007-06-26 at 22:55 -0400, Sylvain Saleur wrote: > > Hello! > > > > I'm trying to change the background color of a part of my program. > > I would like the background in white but I don't know how to do it... > > > > If you have any suggestion... > > The FAQ is your friend :-) It tells you the answer to this question and > many others. > > By the way it's listed at the bottom of every message on this list. > > > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ > > -- > John Dennis <[EMAIL PROTECTED]> > > _______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
