One can accept this king of exception, but in that
case a constructor like
k = wx.Colour('RED')
object.SetBackgroundColour(k)
should work and not fail.
Hovever, this constructor works
k = wx.NamedColour('RED')
object.SetBackgroundColour(k)
k = wx.Colour('#ff00ff') also fails.
and
k = wx.NamedColour('#ff00ff')
understand the #ff0000 as a wrong name. That's ok.
One another aspect of confusion lies in the demo.
In wxPython, there are two colours databases.
1) TheColourDatabase wxWindows/wxPython
2) the database from the module colourdb wxPython only?
The demo does not emphasize, it is using the second database.
One can accept this king of exception, but in that
case a constructor like
k = wx.Colour('RED')
object.SetBackgroundColour(k)
should work and not fail.
That could be possible in 2.5 but I would have to disable kwargs for the constructor, but it's never really been an issue in the past and good docs will help even more in the future.
Hovever, this constructor works
k = wx.NamedColour('RED')
object.SetBackgroundColour(k)
k = wx.Colour('#ff00ff') also fails.
and
k = wx.NamedColour('#ff00ff')
understand the #ff0000 as a wrong name. That's ok.
One another aspect of confusion lies in the demo.
In wxPython, there are two colours databases.
1) TheColourDatabase wxWindows/wxPython
2) the database from the module colourdb wxPython only?
Not really, the colourdb module is meant to load a set of additional colour names and rgb values into TheColourDatabase. That list of names/values also happens to be available directly as Python lists.
The demo does not emphasize, it is using the second database.
Yeah, the overview string for the demo sample could be more helpful than just "".
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I'm not going to comment on the rest since I'm sorta right there with you
One another aspect of confusion lies in the demo.
In wxPython, there are two colours databases.
1) TheColourDatabase wxWindows/wxPython
2) the database from the module colourdb wxPython only?
The demo does not emphasize, it is using the second database.
Therein is one of the reasons that I am going to focus on clarifying and
updating all the demo modules after 2.5 rolls out (the reason for *after*
is, simply put, it's going to take a LONG time to do it the way I want it
done)
To answer one question: colourdb is indeed wxPython only, and for the *most*
part this is true of any of the python libs in wx.lib (there are exceptions
where an unimplemented feature is fully implemented in Python).
Oh, and actually, if you look at the source code for lib.colourdb.py, you'll
find waaaaay down at the bottom that it IS using wx.TheColourDatabase. This
is just a wrapper that makes it easier to use.
Oh, but let me add, I'll be looking for ways to emphasize and/or illustrate
both the wrapper colourdb and the native control of the colour database in
the future demos.