On Mon, 8 Oct 2001, Skip Montanaro wrote:
>
> How do I set the foreground color of a widget without using rc files or
> strings? I've tried this (w being a displayed gtk.Button instance in my
> example)
>
> gc = w.window.new_gc()
> color = gtk.gdk.color_parse("red")
> w.modify_fg(gtk
No, you're changing the style that the label is using when drawing
itself on its parent.
Matt
On Mon, Oct 08, 2001 at 03:48:46PM -0500, Skip Montanaro wrote:
>
> Matt> That means you want to modify the *label* inside the button:
>
> Thanks, that works as I had hoped, but I thought Label wi
Matt> That means you want to modify the *label* inside the button:
Thanks, that works as I had hoped, but I thought Label widgets didn't have
their own windows, so you had to make fg/bg changes to the window they lived
in?
Skip
___
pygtk mailing l
That means you want to modify the *label* inside the button:
import gtk
def click(b, *args):
label = b.get_child()
b.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("red"))
label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("green"))
def mainquit(*args):
gtk.main_quit()
def
Matt> On Mon, Oct 08, 2001 at 11:09:51AM -0500, Skip Montanaro wrote:
>>
>> gc = w.window.new_gc()
>> color = gtk.gdk.color_parse("red")
>> gc.set_foreground(color)
Matt> You'd be surprised, but it's actually the background that you want
Matt> to modify here.
Ma
On Mon, Oct 08, 2001 at 11:09:51AM -0500, Skip Montanaro wrote:
>
> gc = w.window.new_gc()
> color = gtk.gdk.color_parse("red")
> gc.set_foreground(color)
You'd be surprised, but it's actually the background that you want to
modify here.
w.modify_bg(gtk.STATE_NORMAL, color)
Cheers,
How do I set the foreground color of a widget without using rc files or
strings? I've tried this (w being a displayed gtk.Button instance in my
example)
gc = w.window.new_gc()
color = gtk.gdk.color_parse("red")
w.modify_fg(gtk.STATE_NORMAL, color)
and
gc = w.window.new_gc()