I would like to be able to change a button during the runtime of a gui. I can change the value no problem (set Label) but I need to change the size of the button as well. I have managed to change it with SetSize((120, 30)) but then the button scoots under the next button along.
I would like to change the self.okay_button's value from "OK" to "Edit Birdlist" and it will need to be much wider.
I have tried to use Show/Hide, but then the new button gets put right up at the top of the gui.
Do I need to put my buttons inside another sizer? What is the best way to do this.
I also need to be able to change the even, but I think that should be rather easy? But I would appreciate comments on that.
#Buttons hbox_buttons = wx.BoxSizer(wx.HORIZONTAL) #### Here is the part I want to be able to change self.okay_button = wx.Button(self.panel, -1, "OK", size=(70, 30)) hbox_buttons.Add(self.okay_button, 0) #### html_button = wx.Button(self.panel, -1, "Build HTML", size=(120, 30)) hbox_buttons.Add(html_button, 0) exit_button = wx.Button(self.panel, -1, "Close", size=(70, 30)) hbox_buttons.Add(exit_button, 0) vbox.Add(hbox_buttons, 0, wx.ALIGN_RIGHT | wx.RIGHT, 10) self.Bind(wx.EVT_BUTTON, self.getData, id=self.okay_button.GetId()) #I will need a button event: self.ChangeBirdlist #when this usually hidden button is there. self.Bind(wx.EVT_BUTTON, self.getHtml, id=html_button.GetId()) self.Bind(wx.EVT_BUTTON, self.OnQuit, id=exit_button.GetId())