Re: [Goocanvas-devel] fill/stroke_color_rgba on 32-bit machines using python bindings



Le samedi 25 avril 2009 à 11:05 -0700, Brandon Lewis a écrit :
> Bruno Coudoin wrote:
> > Le vendredi 17 avril 2009 à 00:20 -0700, Brandon Lewis a écrit :
> >> I am having some difficulty with setting colors on goocanvas objects on 32-bit 
> >> machines. Essentially what I do is pack the values from a gtk.gdk.Color object 
> >> into a 32-bit word and assign it to the fill/stroke color properties.
> >>
> >> The problem is that on 32-bit machines, some color values exceed python's limit 
> >> on the size of an int (since it has no unsigned type) and get promoted to longs. 
> >> When this happens, the goocanvas bindings can't convert the value (which is 
> >> still only 32-bits wide)
> >>
> >> Anyone have any suggestions on how to deal with this?
> > 
> > You can force python to set a long value by appending an L at the end of
> > the value like in color_rgba= 0xF44B9DFFL
> > 
> 
> But then goocanvas will reject it. All this does is specify that the literal 
> value is a long. The issue is that goocanvas refuses to convert python longs to 
> ints even when the value would fit within 32-bits.

I confused. Please give an example of what does not work for you. In
GCompris there are tons of code that sets colors and I got no issue once
I append a L to the value.

-- 
Bruno Coudoin
http://gcompris.net  Free educational software for kids
http://toulibre.org  Logiciel Libre à Toulouse
http://april.org     Promouvoir et défendre le Logiciel Libre



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]