Using color names on Windows vs. Linux

Stefan Reichör stefan at xsteve.at
Wed Apr 25 01:04:21 PDT 2007


Hi!

I'd like to use some colors in global python variables. The colors are
correctly defined on linux. On Windows they are wrong after the
"import wx" statement. They are valid after I have created an
application object. I use wxPython2.8.1.1 on Windows.

I think this behaviour is a bug.

Stefan.



import wx

cWarningColor = wx.TextAttr("BLUE", wx.NullColour)
cErrorColor = wx.TextAttr("RED", wx.NullColour)
print "Wrong color constants on windows?:", cWarningColor.GetTextColour(), cErrorColor.GetTextColour()

application = wx.PySimpleApp()

cWarningColor = wx.TextAttr("BLUE", wx.NullColour)
cErrorColor = wx.TextAttr("RED", wx.NullColour)
print "Correct color constants on windows:", cWarningColor.GetTextColour(), cErrorColor.GetTextColour()


Output on Windows:
Wrong color constants on windows?: (248, 0, 33, 0) (248, 0, 33, 0)
Correct color constants on windows: (0, 0, 255, 255) (255, 0, 0, 255)

Output on Linux:
Wrong color constants on windows?: (0, 0, 255, 255) (255, 0, 0, 255)
Correct color constants on windows: (0, 0, 255, 255) (255, 0, 0, 255)





More information about the wxpython-users mailing list