RE: [wxPython] Bug in MDI child windows?
This seems to be about as small as I can make it and still crash.
If you remove the LibraryFrame or the sash window in the StoryFrame, the problem does not occur.
from wxPython.wx import *
from wxPython.lib.anchors import LayoutAnchors
class GUIApp(wxApp):
def OnInit(self):
MainWindow = MainFrame(NULL)
MainWindow.Show(TRUE)
self.SetTopWindow(MainWindow)
return TRUE
class MainFrame(wxMDIParentFrame):
def __init__(self, parent):
wxMDIParentFrame.__init__(self, parent, -1, 'Wibble MDI')
self.SetMenuBar(wxMenuBar())
x = LibraryFrame(self)
y = StoryFrame(self)
class LibraryFrame(wxMDIChildFrame):
def __init__(self, parent):
cx, cy = parent.GetClientSize()
wxMDIChildFrame.__init__(self, parent, -1, 'Library', (0, 0), (200, cy-4), style=wxSTAY_ON_TOP)
class StoryFrame(wxMDIChildFrame):
def __init__(self, parent):
wxMDIChildFrame.__init__(self, parent, -1, "Story", style=wxDEFAULT_FRAME_STYLE)
self.BodyTextCtrl = wxTextCtrl(self, -1, style=wxTE_MULTILINE)
EVT_SIZE(self, self.OnSize)
pw, ph = self.GetClientSizeTuple()
tp = wxSashLayoutWindow(self, -1, wxDefaultPosition,
(pw, 80), style=wxCLIP_CHILDREN | wxSW_3D)
tp.SetOrientation(wxLAYOUT_HORIZONTAL)
tp.SetAlignment(wxLAYOUT_TOP)
tp.SetSashVisible(wxSASH_BOTTOM, TRUE)
tp.SetDefaultSize(wxSize(pw, 80))
def OnSize(self, event):
wxLayoutAlgorithm().LayoutWindow(self, self.BodyTextCtrl)
if name == ‘main’:
app = GUIApp(0)
app.MainLoop()
I hope I’m not doing something dumb.
Thanks.
Dale Strickland-Clark
Riverhall Systems Ltd. Custom database and Web applications.
Offices: London & Wokingham
···
-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Fri, 2002 January 11 16:40
To: wxpython-users@lists.wxwindows.org
Subject: Re: [wxPython] Bug in MDI child windows?
The child window contains a wxSashLayoutWindow, which may be
relevant. Child windows without the sash seem OK.
Does it still crash if they havn’t been maximized?
No.
Send a sample then
–
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!
wxpython-users mailing list