Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to inset a panel into a BoxSizer in wxPython
    text
    copied!<p>I am trying to make something that looks like an installer without actually installing anything ( I am using it to explore wxPython) .And right now I'm trying to put a panel on another panel, but when ever I do that the window shows up grey and only the corner of one button shows . </p> <pre><code>import wx class PanelOne(wx.Panel): def __init__(self,*args,**kwargs): wx.Panel.__init__(self,*args,**kwargs) def initUI(self): vbox=wx.BoxSizer(wx.VERTICAL) vbox.Add(wx.StaticText(self,-1,'This is Panel One'),0,wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL) vbox.SetSizeHints(self) self.SetSizer(vbox) self.Show(True) class Gui(wx.Frame): def __init__(self,*args,**kwargs): wx.Frame.__init__(self,*args,**kwargs) self.initUI() self.tTips() def initUI(self): panel=wx.Panel(self) self.vbox=wx.BoxSizer(wx.VERTICAL) panel.SetSizer(self.vbox) ##This is what im having trouble with p1=PanelOne(self) self.vbox.Add(p1,3,wx.ALL,10) ## btnBox=wx.BoxSizer(wx.HORIZONTAL) #This Sizer is for the box that will hold the next and back buttons. backBtn=wx.Button(panel,-1,'&amp;Back')# back button backBtn.Bind(wx.EVT_BUTTON,self.onBack) btnBox.Add(backBtn,0,wx.ALL,10) nextBtn=wx.Button(panel,-1,'&amp;Next')# next button nextBtn.Bind(wx.EVT_BUTTON,self.onNext) btnBox.Add(nextBtn,0,wx.ALL,10) self.vbox.Add(btnBox) self.vbox.SetSizeHints(self) self.Show(True) def onNext(self,e): pass def onBack(self,e): pass def tTips(self): pass if __name__ == '__main__': app=wx.App() gui=Gui(None,-1,'Title Yo') app.MainLoop() </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload