All,
I have a frame in which I have a panel. In the panel a vertical sizer putting content in the top and buttons in the bottom. So far so good.
Now I want to flip the frame (the panel actually) from show to edit mode. So I do self.DestroyChildren() on the panel and run the function for populating the thing again but now in the edit mode makeTypePanel(self,self.object,self.i18n,'e', self.legalmodes,self)
def makeTypePanel(panel,obj,i18n,basemode, legalmodes,events2):
#make the sizers:
box=wx.BoxSizer(wx.VERTICAL)
buttons=wx.BoxSizer(wx.HORIZONTAL)
#make the content
content=makeTypeSubPanel(panel,obj,i18n,basemode,legalmodes,name=typename)
#and make buttons:
buttonCommit=wx.Button(panel,-1,doI18N("COMMIT",i18n,typename),name="button_commit")
buttons.Add(buttonCommit,0,wx.EXPAND|wx.ALIGN_RIGHT)
buttonDone=wx.Button(panel,-1,doI18N("CANCEL",i18n,typename),name="button_cancel")
buttons.Add(buttonDone,0,wx.EXPAND|wx.ALIGN_RIGHT)
box.Add(content,1,wx.EXPAND)
box.Add(buttons,0,wx.ALIGN_RIGHT)
panel.SetSizer(box,True)
panel.Fit()
panel.Show()
now this gives me a nice refreshed panel with all the content in edit mode but no buttons.
What am I missing here. Should I have removed the sizer (if so how?) or what is happening?
Paul
···
--
Paul Sijben tel: +31334566488
Eemvalley Technology fax: +31334557523
the Netherlands http://eemvalley.com