On Fri, 2003-04-04 at 08:24, John Hunter wrote: > >>>>> "Steve" == Steve McClure <[EMAIL PROTECTED]> writes: > > Steve> That's probably not practical, but I am using the new gc in > Steve> the draw_line and draw_point commands. > > Hmmm... Here's an old script I worked with when I was first learning > pygtk that should run under pygtk-0.6.4 and draws in a specified > color. Does it draw in dark slate gray when you run it? If so, try > and figure out what is different from your code. >
[ script deleted ]
Yes, that works fine, producing dark slate gray ovals.
I added print statements around the gc creation and setup and get the
same sort of results
# this is DarkSlateGray on a (255,255,255) color scale. I
# multiply by 255 to scale to the units of alloc, which are
# 0-65535 for each (R,G,B) value
color = cmap.alloc(49*255,79*255,79*255)
print 'color: ', color
gc = widget.get_parent_window().new_gc()
print 'before:', gc.foreground
gc.foreground = color
print 'after:', gc.foreground
produces:
color: <GdkColor (12495, 20145, 20145)>
before: <GdkColor (22680, 16385, 24376)>
after: <GdkColor (15488, 16409, 1)>
color: <GdkColor (12495, 20145, 20145)>
before: <GdkColor (15488, 16409, 1)>
after: <GdkColor (15488, 16409, 1)>
So I guess that debugging method cannot be relied upon and that your
thought that I must not be using the right gc is correct. Unfortunately
I have no idea how the color came to be blue.
Thanks for the help.
> _______________________________________________
> pygtk mailing list [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
--
Steve McClure <[EMAIL PROTECTED]>
Racemi, Inc.
signature.asc
Description: This is a digitally signed message part
_______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
