pygtk2 and colors

Cousin Stanley cousinstanley at gmail.com
Tue Jul 7 12:54:03 EDT 2015


> With python 2.7.5, pygtk 2.24, gtk 2.24:
> The following snippet successfully sets the line_width 
> but not the foreground color, and I can't figure-out why. 
> 
> The color human-name and the result returned 
> by gtk.gdk.color_parse are correct. Clues? Thanks.
> 
> self.gc.set_line_attributes(myclass.board_line_width, gtk.gdk.LINE_SOLID,
>
> gtk.gdk.CAP_ROUND, gtk.gdk.JOIN_BEVEL)
>
> fg = gtk.gdk.color_parse(myclass.board_foreground)
>
> self.gc.set_foreground(fg)
>

  You might try .... 

    self.set_rgb_fg_color( fg ) 


  Example from ... 

    http://www.linuxplanet.com/linuxplanet/tutorials/6750/2/

 

-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona



More information about the Python-list mailing list