Problem on SetBackgroundColour()

Hi,

I' am new to python and wxPython
and I try some python scripts on a Linux-System:
Linux 2.6.11.4-21.17-smp
Python 2.4
wxPython 2.8.4.2

Problem:
I do not manage to set and see any background colour.

I try to understand sizers
and I run this from http://wiki.wxpython.org/UsingSizers

···

----------------------------------------------------------
#!/usr/bin/python

import wx

class MyFrame(wx.Frame):
   def __init__(self, parent, ID, title):
       wx.Frame.__init__(self, parent, ID, title, size=(300, 250))

       panel1 = wx.Panel(self,-1, style=wx.SUNKEN_BORDER)
       panel2 = wx.Panel(self,-1, style=wx.SUNKEN_BORDER)

       panel1.SetBackgroundColour("BLUE")
       panel2.SetBackgroundColour("RED")

       box = wx.BoxSizer(wx.VERTICAL)
       box.Add(panel1, 2, wx.EXPAND)
       box.Add(panel2, 1, wx.EXPAND)

       self.SetAutoLayout(True)
       self.SetSizer(box)
       self.Layout()

app = wx.PySimpleApp()
frame = MyFrame(None, -1, "Sizer Test")
frame.Show()
app.MainLoop()
----------------------------------------------------------

It appears, sizers work,
but no background colours.
The background is always grey.

Also an all other scripts I tried so far.

What is the problem??
Thanks for any help.

Grüessli
--
Kurt Müller:
kurt.mueller@aerodynamics.ch

Kurt Mueller <kurt.mueller <at> aerodynamics.ch> writes:

Hi,

I' am new to python and wxPython
and I try some python scripts on a Linux-System:
Linux 2.6.11.4-21.17-smp
Python 2.4
wxPython 2.8.4.2

Problem:
I do not manage to set and see any background colour.

Kurt,
your program works fine on my pc (with xp).
I don't know what is the problem.
May be you should just update to the latest versions (python 2.5 and
wxpython2.8.6.0 for py2.5).
Or wait for pros to help you more than I do...
Dominique

Kurt Mueller wrote:

Hi,

I' am new to python and wxPython
and I try some python scripts on a Linux-System:
Linux 2.6.11.4-21.17-smp
Python 2.4
wxPython 2.8.4.2

Problem:
I do not manage to set and see any background colour.

It appears, sizers work,
but no background colours.
The background is always grey.

Try changing your GTK theme. Some themes do not allow bg and/or fg colors to change. For the panel bg I expect that if the theme is using a pixmap background then that may totally override any simple color bg settings.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!