X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..d0ee33f5c6908b4ac5e1364381f0ef00942e3936:/wxPython/wx/lib/colourdb.py diff --git a/wxPython/wx/lib/colourdb.py b/wxPython/wx/lib/colourdb.py index ec9ae457f2..c053c5ce0f 100644 --- a/wxPython/wx/lib/colourdb.py +++ b/wxPython/wx/lib/colourdb.py @@ -12,16 +12,19 @@ #---------------------------------------------------------------------- """ -Load color names/values from the rgb.txt file on my system... +Load addition color names/values into the wx colour database. These +names and values originally came from the rgb.txt file on my system... """ def getColourList(): + """Returns a list of just the colour names used by this module.""" return [ x[0] for x in getColourInfoList() ] def getColourInfoList(): + """Returns the list of colour name/value tuples used by this module.""" return [ ("SNOW", 255, 250, 250), ("GHOST WHITE", 248, 248, 255), @@ -659,11 +662,15 @@ def getColourInfoList(): _haveUpdated = False def updateColourDB(): + """Updates the wx colour database by adding new colour names and RGB values.""" global _haveUpdated if not _haveUpdated: - from wxPython.wx import wxTheColourDatabase + import wx + assert wx.GetApp() is not None, "You must have a wx.App object before you can use the colour database." cl = getColourInfoList() + for info in cl: - wxTheColourDatabase.Append(*info) - + wx.TheColourDatabase.Append(*info) + + _haveUpdated = True