Odd grey background

Hi,

On Windows, why is it that whenever I create a window the background is
this funny dark grey colour and not the normal Windows light grey?

Here's my code for creating the main window:

class MainWindow(wxFrame):
    def __init__(self, parent, id, title):
        wxFrame.__init__(self, parent, -4, title, size = ( 100, 100),
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)

        self.mainSizer = wxBoxSizer(wxHORIZONTAL) # Main sizer: holds
vsizer1 & hsizer2
        self.optionsSizer = wxBoxSizer(wxVERTICAL) # Will hold all
options
        self.mainSizer.Add(self.optionsSizer, 0, wxEXPAND)
        self.volLabelSizer = wxBoxSizer(wxHORIZONTAL)
        self.optionsSizer.Add(self.volLabelSizer, 0, wxEXPAND)
        self.volLabelStatic = wxStaticText(self, -1, "Label:")
        self.volLabelText = wxTextCtrl(self, -1, "", size=(125, -1))
        self.volLabelSizer.Add(self.volLabelStatic, 0, wxEXPAND, 15)
        self.volLabelSizer.Add(self.volLabelText, 0, wxEXPAND)
        self.SetSizer(self.mainSizer)
        # self.SetAutoLayout(1)
        self.mainSizer.Fit(self)
        self.Show(true)

app = wxPySimpleApp()
frame = MainWindow(None, -1, "My Window")
frame.Maximize(true)
frame.Show(true)
app.MainLoop()

Regards,
Wayne

Wayne Koorts wrote:

Hi,

On Windows, why is it that whenever I create a window the background is
this funny dark grey colour and not the normal Windows light grey?

That dark grey actually IS the default Windows background color for frames: try opening MS Word and closing all documents.

You probably want to add a wxPanel to your frame and make the rest of the controls children of the panel. The background for the panel should be the light grey you are expecting.

David

···

Here's my code for creating the main window:

class MainWindow(wxFrame):
   def __init__(self, parent, id, title):
       wxFrame.__init__(self, parent, -4, title, size = ( 100, 100),
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)

       self.mainSizer = wxBoxSizer(wxHORIZONTAL) # Main sizer: holds
vsizer1 & hsizer2
       self.optionsSizer = wxBoxSizer(wxVERTICAL) # Will hold all
options
       self.mainSizer.Add(self.optionsSizer, 0, wxEXPAND)