Dear All,

I am not able to set some of the attributes a gtk.gdk.GC object for my gtk
widget. Particularly,
the attribute 'foreground' of type gtk.gdk.Color. Here is a snippet from my
python interpreter command-line:

<snippet>
1>>> from AceStudio import scope
2>>> s = scope.new()
3>>> w = s.GUI.drawing_area.window
4>>> w
<gtk.gdk.Window object (GdkWindow) at 0x40b5fb44>
5>>> gc = w.new_gc()
6>>> gc
<gtk.gdk.GCX11 object (GdkGCX11) at 0x40b5fc0c>
7>>> gc.foreground
<GdkColor at 0x82cdc50>
8>>> gc.foreground.red
65535
9>>> import gtk
10>>> color = gtk.gdk.color_parse('#00FF00')
11>>> color
<GdkColor at 0x82cdc50>
12>>> color.red
0
13>>> gc.foreground
<GdkColor at 0x82cdc5c>
14>>> gc. foreground = color
15>>> gc.foreground
<GdkColor at 0x82cdc68>
16>>> gc.foreground.red
65535
17>>> gc.set_values(foreground=color)
18>>> gc.foreground
<GdkColor at 0x82cdc68>
19>>> color
<GdkColor at 0x82cdc50>
20>>> gc.foreground.red
65535
21>>> gc.fill
0
22>>> gc.fill = 1
23>>> gc.fill
1
</snippet>

Command 5 creates a new GC for my widget. gc.foreground and
gc.foreground.red have default values. I create a 
new color object (Command 10) and assign it to the attribute 'foreground'
(Commands 14 & 17). However, gc.foreground continues to have the old values.

At the same time, I can succesfully set gc.fill (Command 22).

Can any one please explain what is going on here...


Thanks,
- Chetan


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .


_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to