Hi Gentlemen,

I have an error, which was non existant when i used wxpython 2.8.7.1. When i upgraded to 2.8.10.1, basically the GUI got messed up.I am using Python 2.52 environment.

The error seems to be from the fact that the parent, in this case
MyFrame(wx.aui.AuiMDIParentFrame), is the default frame, which means i did not have to have a wx.window passed as the argument, while, auimanager seems to look for a panel to attach too? Please take a look at the self running code below. Any comment is appreciated.

Thank you very much

import wx
import wx.aui
#----------------------------------------------------------------------
class MyFrame(wx.aui.AuiMDIParentFrame):
    def __init__(self, parent):
        wx.aui.AuiMDIParentFrame.__init__(self, parent, -1,
                                          title="AuiMDIParentFrame",
                                          size=(640,480),
                                          style=wx.DEFAULT_FRAME_STYLE)
        self.x=0
        self._mgr = wx.aui.AuiManager(self)
        
        self._mgr.AddPane(self.CreateTreeCtrl(), wx.aui.AuiPaneInfo().
                          Name("test8").Caption("BIST OVERVIEW").
                          Left().Layer(1).Position(1).CloseButton(True).
                          MaximizeButton(True))
        
        self._mgr.AddPane(self.OnNewChild(), wx.aui.AuiPaneInfo().
                          Caption("HTML Content").
                          Float().FloatingPosition(self.GetStartPosition()).
                          FloatingSize(wx.Size(300, 200)).CloseButton(True).
                          MaximizeButton(True))
        self._mgr.Update()
        
    def CreateTreeCtrl(self):
        self.tree = wx.TreeCtrl(self,-1,wx.Point(0,0),
                                wx.Size(130,100),
                                wx.TR_DEFAULT_STYLE|wx.NO_BORDER)
        return self.tree
    
    def OnNewChild(self):
        child = ChildFrame(self,wx.DefaultPosition, wx.Size(400, 300))
        child.Show()
        
    def GetStartPosition(self):
        self.x = self.x + 20
        x = self.x
        pt = self.ClientToScreen(wx.Point(0, 0))
        return wx.Point(pt.x + x, pt.y + x)
#----------------------------------------------------------------------        
class ChildFrame(wx.aui.AuiMDIChildFrame):
    def __init__(self, parent, pos,size):
        wx.aui.AuiMDIChildFrame.__init__(self, parent, -1,title='bist')
        p = wx.Panel(self,-1)
        wx.StaticText(p, -1, "This is child ")
        p.SetBackgroundColour('light blue')
        sizer = wx.BoxSizer()
        sizer.Add(p, 1, wx.EXPAND)
        self.SetSizer(sizer)
        wx.CallAfter(self.Layout)
#----------------------------------------------------------------------#        
class MainApp(wx.App):
    def OnInit(self):
        self.frame =MyFrame(None)
        self.frame.Show(True)
        self.frame.Maximize()
        self.SetTopWindow(self.frame)
        return True

if __name__ == '__main__':
    app = MainApp(0)
    app.MainLoop()

Recommended Answers

All 3 Replies

Looks like a bug in wxPython version 2.8.10.1
Can you go back to version 2.8.7.1 ?

Hi Vega,

Yes, i should be able too. Where do we highlight this 'bug', to get it fixed. There are some new rendered features in the new wxpython release that would prove good edition to GUI development. Anyone have experience highlighting these issues to the right channel?

Thank you very much

Rgds,
Indran

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.