Hi,
I am programming a grafical interface and I have made a small programme
to open a window with a wxTextCtrl inside, which contains the word
'hello'.
I am using wxLayoutConstraints to assign the width of 50 percent and the
height of 20 percent of the main frame.
Now my question :
I don't understand why the workspace of the main frame is dark grey and
therefore does not have the same colour as the menu bar..
What can I do to get the workspace with the same colour as the menu bar?
Thanks for your help.
Graziella
···
--------------------------------------------------
from wxPython.wx import *
ID_EXIT = NewId()
ID_OPEN = NewId()
wxID_TESTFRAME = NewId()
class MyFrame(wxFrame):
def __init__(self, parent):
self._init_ctrls(parent)
self._initConstraints()
def _init_ctrls(self, parent):
wxFrame.__init__(self, parent, wxID_TESTFRAME, 'test',
size = wxSize(600, 400))
self.SetAutoLayout(true)
menu = wxMenu()
menu.Append(ID_OPEN, "O&pen", "Open new file")
menu.AppendSeparator()
menu.Append(ID_EXIT, "E&xit", "Terminate the program")
menuBar = wxMenuBar()
menuBar.Append(menu, "&File");
self.SetMenuBar(menuBar)
self.text2 = wxTextCtrl(self, 30, "hello")
def _initConstraints(self):
c = wxLayoutConstraints()
c.left.SameAs(self, wxLeft,130)
c.bottom.SameAs(self, wxBottom, 150)
c.width.PercentOf(self, wxWidth,50)
c.height.PercentOf(self, wxHeight,20)
self.text2.SetConstraints(c)
self.Layout()
class MyApp(wxApp):
def OnInit(self):
frame = MyFrame(None)
frame.Show(true)
return true
frame.Destroy()
app = MyApp()
app.MainLoop()
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users