Mehrfach geteiltes Frame mit wx.SplitterWindow

Plattformunabhängige GUIs mit wxWidgets.
Antworten
Bluecaspar
User
Beiträge: 27
Registriert: Samstag 18. März 2006, 20:06

Hallo,

ich möchte ein Frame das in mehrere größenverschiebare Panels unterteilt ist. Eine Unterteilung bekomme ich ohne Probleme hin. Nur darüber hinaus bekomm ich keine weiter Unterteilung hin.

Was könnte an diesem Code falsch sein?

Code: Alles auswählen

import wx

class MainFrame(wx.Frame): 
    def __init__(self):  
        wx.Frame.__init__(self, None, -1)  
        
##        # One splitted Frame
##        self.sp = wx.SplitterWindow(self)
##        self.panel1 = wx.Panel(self.sp,style=wx.SUNKEN_BORDER)
##        self.panel2 = wx.Panel(self.sp,style=wx.SUNKEN_BORDER)
##        self.panel1.SetBackgroundColour("white")
##        self.panel2.SetBackgroundColour("white")
##        self.sp.SplitVertically(self.panel1, self.panel2, 100)  


        # Several spitted Frame
        sp1 = wx.SplitterWindow(self)
        p0 = wx.Panel(sp1)
        sp2 = wx.SplitterWindow(p0)
        
        p1 = wx.Panel(sp1,style=wx.SUNKEN_BORDER)
        p2 = wx.Panel(sp2,style=wx.SUNKEN_BORDER)
        p3 = wx.Panel(sp2,style=wx.SUNKEN_BORDER)
        
        p1.SetBackgroundColour("white")
        p2.SetBackgroundColour("white")
        p3.SetBackgroundColour("white")
        
        sp1.SplitHorizontally(p0, p1, 200)
        sp2.SplitHorizontally(p2, p3, 100)
   
             
app = wx.PySimpleApp()  
MainFrame().Show()  
app.MainLoop()  
Antworten