Re: pygtk2 and colors

2015-07-10 Thread nickgeovanis
I may be phrasing this question improperly, but...If I need a canvas or canvas-like object, does GTK3/pygobject provide one? Or only GTK2/PyGTK? The answer seems to be "only GTK2/PyGTK" but the discussion I find online doesn't seem to have a clear answer. -- https://mail.python.org/mailman/lis

Re: pygtk2 and colors

2015-07-07 Thread nickgeovanis
On Tuesday, July 7, 2015 at 12:58:12 PM UTC-5, Chris Angelico wrote: > > Part of your confusion may be because "background" isn't necessarily > what you think it is. Indeed. Yet "foreground" _is_ what I think it is :-) I would argue that we have here a clumsy intrusion of OO inheritance into a

Re: pygtk2 and colors

2015-07-07 Thread Chris Angelico
On Wed, Jul 8, 2015 at 3:25 AM, wrote: > On Tuesday, July 7, 2015 at 11:54:21 AM UTC-5, Cousin Stanley wrote: >> You might try >> >> self.set_rgb_fg_color( fg ) > > Well thanks, that works. Yet set_rgb_bg_color() does not. And I notice that > the example at the link you sent doesn't s

Re: pygtk2 and colors

2015-07-07 Thread nickgeovanis
On Tuesday, July 7, 2015 at 11:54:21 AM UTC-5, Cousin Stanley wrote: > You might try > > self.set_rgb_fg_color( fg ) Well thanks, that works. Yet set_rgb_bg_color() does not. And I notice that the example at the link you sent doesn't set the background color either. Do I have a col

Re: pygtk2 and colors

2015-07-07 Thread Cousin Stanley
> 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

Re: pygtk2 and colors

2015-07-07 Thread Chris Angelico
On Wed, Jul 8, 2015 at 12:47 AM, wrote: > Hi Nick, > Doing colors with pygtk2 is a real pain... I understand there's a different set of GTK bindings, pygobject. But I've not used it, so I don't know if it's more pythonic in style. Might be worth considering. ChrisA -- https://mail.python.org/m

Re: pygtk2 and colors

2015-07-07 Thread bkimstunnaboss
Hi Nick, Doing colors with pygtk2 is a real pain... But to change the foreground, what you wanna do is to get a copy of the style of the widget, set the color values on it, and then set it back as the style. Like so... color = gtk.gdk.color_parse('#ac0102') style = self.get_style().copy()