Hi,
I have a problem changing the background colour of different widgets (see
example) under Linux. I've tested the example on windows and on linux (with
different WindowManagers) with the following results.
Should I write a bug-report?
My System:
Windows XP SP 2
S.u.S.E Linux 9.2
wxPython 2.6.0.0
The Example App:
···
================
import wx
class _MainFrame(wx.Frame):
def __init__(self, parent, ID, title):
wx.Frame.__init__(self, parent, ID, title,
wx.DefaultPosition, wx.Size(800, 600))
# Panel
#
# Windows: Ok
# Gnome: Ok
# KDE: Fails
# fvwm2: Ok
# TWM: Ok
# WindowMaker: Ok
self.Panel = wx.Panel(self)
self.Panel.SetBackgroundColour(wx.RED)
self.TopSizer = wx.BoxSizer(wx.VERTICAL)
# StaticText
#
# Windows: Ok
# Gnome: Fails
# KDE: Fails
# fvwm2: Ok
# TWM: Ok
# WindowMaker: Ok
self.Text = wx.StaticText(self.Panel, -1, "Hello World")
self.Text.SetBackgroundColour(wx.GREEN)
self.TopSizer.Add(self.Text, 0, wx.EXPAND | wx.ALL, 5)
# Button
#
# Windows: Ok
# Gnome: Fails
# KDE: Fails
# fvwm2: Ok
# TWM: Ok
# WindowMaker: Ok
self.Button = wx.Button(self.Panel, -1, "Hello World")
self.Button.SetBackgroundColour(wx.GREEN)
self.TopSizer.Add(self.Button, 0, wx.EXPAND | wx.ALL, 5)
# TextCtrl
#
# Windows: Ok
# Gnome: Shows a green frame around the widget
# KDE: Fails
# fvwm2: Ok
# TWM: Ok
# WindowMaker: Ok
self.TextCtrl = wx.TextCtrl(self.Panel, -1)
self.TextCtrl.SetBackgroundColour(wx.GREEN)
self.TopSizer.Add(self.TextCtrl, 0, wx.EXPAND | wx.ALL, 5)
# Listbox
#
# Windows: Ok
# Gnome: Fails
# KDE: Fails
# fvwm2: Fails
# TWM: Fails
# WindowMaker: Fails
Choices = ["one", "two", "three", "Four"]
self.ListBox = wx.ListBox(self.Panel, -1, choices=Choices)
self.ListBox.SetBackgroundColour(wx.GREEN)
self.TopSizer.Add(self.ListBox, 0, wx.EXPAND | wx.ALL, 5)
# ComboBox
#
# Windows: Ok
# Gnome: Shows a green frame around the widget. The box has a green
# BGColour
# KDE: Fails
# fvwm2: Ok
# TWM: Ok
# WindowMaker: Ok
self.ComboBox = wx.ComboBox(self.Panel, -1, choices=Choices)
self.ComboBox.SetBackgroundColour(wx.GREEN)
self.TopSizer.Add(self.ComboBox, 0, wx.EXPAND | wx.ALL, 5)
self.Panel.SetSizer(self.TopSizer)
class _MyApp(wx.App):
def OnInit(self):
frame = _MainFrame(None, -1, "Test App")
frame.Show(True)
self.SetTopWindow(frame)
return True
if __name__ == '__main__':
app = _MyApp(0)
app.MainLoop()