I finally updated to the latest release to take advantage of some of Andrea’s widgets being bundled. PyProgress is great and I’m replacing the old progress dialog in my code, but it appears to differ from most of the native widgets by requiring a wx.Colo(u)r object for methods such as SetFirstGradientColour. Not a big deal, but a little inconsistent, and I find it very convenient to pass a tuple like (200,200,200) instead. Can this be fixed? (I’m happy to supply a patch myself if that helps.)
I finally updated to the latest release to take advantage of some of
Andrea's widgets being bundled. PyProgress is great and I'm replacing
the old progress dialog in my code, but it appears to differ from most
of the native widgets by requiring a wx.Colo(u)r object for methods such
as SetFirstGradientColour. Not a big deal, but a little inconsistent,
and I find it very convenient to pass a tuple like (200,200,200)
instead. Can this be fixed?
Sure.
(I'm happy to supply a patch myself if
that helps.)
Please do. You can check the type of the value passed in and if it's not an instance of wx.Colour then use wx.NamedColour to try to convert it to one.
Doesn’t it need to test for both str and tuple objects? If it’s a tuple, wx.Colour(color) will do what I need, but it’s easy to make it work either way.
Which code should I use as the base for adding the patch, the 2.8.10.1 version or the latest SVN?
> \(I'm happy to supply a patch myself if
> that helps\.\)
Please do\. You can check the type of the value passed in and if it's
not an instance of wx\.Colour then use wx\.NamedColour to try to convert
it to one\.
Doesn't it need to test for both str and tuple objects?
Nope. There's a sneaky little implementation detail in wx.NamedColour
that has a side effect that makes it work with the tuples too.