Hello wxPython users:
I am trying to create an MDI application that also containts non-MDI windows (see attached demo code). When I drop the wxSashLayoutWindow onto the wxMDIParentFrame, then use wxLayoutConstraints to
fill 30% of the parent's width, the sash window doesn't resize properly (try maximizing the app). Also, the MDIClient area doesn't seem to be taking into account the sashWindow area. The wxPython
documentation states the following:
"An MDI parent frame always has a wxMDIClientWindow associated with it, which is the parent for MDI client frames. This client window may be resized to accommodate non-MDI windows, as seen in
Microsoft Visual C++ (TM) and Microsoft Publisher (TM), where a documentation window is placed to one side of the workspace."
So I know that what I am trying to do can be done, but I can't seem to figure out how and haven't been able to track down a demo that does it. I think it may have something to do with
wxLayoutAlgorithm, but I'm not sure.
Any help would be greatly appreciated. Thanks in advance,
Wayne Boras
from wxPython.wx import *
class testFrame(wxMDIParentFrame):
def __init__(self):
wxMDIParentFrame.__init__(self, None, -1, 'MDI Parent Frame')
self.SetAutoLayout(true)
sashWin = wxSashLayoutWindow(self, -1)
sashWin.SetSashVisible(wxSASH_RIGHT, true)
sashWin.SetOrientation(wxLAYOUT_HORIZONTAL)
lc = wxLayoutConstraints()
lc.top.SameAs(self, wxTop)
lc.left.SameAs(self, wxLeft)
lc.bottom.SameAs(self, wxBottom)
lc.width.PercentOf(self, wxWidth, 30)
sashWin.SetConstraints(lc)
self.Layout()
class testApp(wxApp):
def OnInit(self):
frame = testFrame()
frame.Show(true)
self.SetTopWindow(frame)
return true
def main():
app = testApp(0)
app.MainLoop()
if __name__ == '__main__':
main()
···
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users