I have a window with three widgets. Currently a a text box (TextCrtl) is taking the entire left size of the window, and on the right size, there is another text box, and under it is a button (I spitted the right side horizontally). My question is, how can I flip the widgets, to have the one long text box on the right side, and the smaller text box and button on the left side. Here is my code so far:

import wx

class Frame(wx.Frame):

    def __init__(self, *args, **kwargs):
        super(Frame, self).__init__(*args, **kwargs)

        self.InitUI()

    def InitUI(self):

        splitter1 = wx.SplitterWindow(self, -1,style=wx.SP_LIVE_UPDATE)
        splitter2 = wx.SplitterWindow(splitter1, -1,style=wx.SP_LIVE_UPDATE)
        self.userEnter = wx.TextCtrl(splitter2, -1)
        self.cbtn = wx.Button(splitter2, label='Close')
        self.results = wx.TextCtrl(splitter1, -1)
        #self.graphs = wx.TextCtrl(splitter1, -1)

        splitter1.SplitVertically(self.results, splitter2)
        splitter2.SplitHorizontally(self.userEnter, self.cbtn)


        menubar = wx.MenuBar()
        fileMenu = wx.Menu()
        wx.ID_EXIT = 10
        quitButton = fileMenu.Append(10, 'Quit', 'Quit this program')
        menubar.Append(fileMenu, '&File')
        self.SetMenuBar(menubar)

        self.Bind(wx.EVT_MENU, self.OnQuit, quitButton) 

        self.SetSize((1090,750))
        self.SetTitle('Plancials Booky')
        self.Centre()
        self.Show(True)

    def OnQuit(self, e):
        self.Close()        

def main():     
    app = wx.App()
    Frame(None)
    app.MainLoop()

if __name__=="__main__":
    main()  

Thanks.

有帮助吗?

解决方案

Just change the order of widgets in splitter1.SplitVertically:

splitter1.SplitVertically(splitter2, self.results)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top