[pygtk] how to new a gc and set foreground color
Frank Zheng
hustzxq524 at gmail.com
Wed Jul 19 10:40:45 WST 2006
hi, this is my first time to visit here. say hello to every body!
I met a problem about set fg color to a new created gc as following code
show:
def area_expose(area, event):
gc =3D area.window.new_gc()
color =3D gtk.gdk.Color(65535,0,0) # red
gtk.gdk.colormap_get_system().alloc_color(color)
gc.set_foreground(color)
#then do some drawing on area.window
but color not be set porperly as I want.
I used to do like this with pure gtk+, it works fine
I googled and changed like this:
gc.set_rgb_fg_color(color)
now it works.
any one can tell me why this happened?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20060719/d77f6686/at=
tachment.htm
More information about the pygtk
mailing list