Jan-20-2017, 04:54 PM
The code:
First and more important, why is the choicebox not shown? I simply get an empty window.
Second, how to make SetMinSize and SetMaxSize doing something, in the best case even influencing the panelsize? Actually, they just seem to do... nothing.
import wx showliste = ["item1", "item2", "item3"] class Mainframe(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title) self.shopanel = Shopanel(self, id) vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.shopanel, 0, wx.EXPAND) self.SetSizer(vbox) self.Show() class Shopanel(wx.Panel): def __init__(self, parent, id): wx.Panel.__init__(self, parent, id) self.SetMinSize((100, 100)) self.SetMaxSize((150, 150)) chos = wx.MultiChoiceDialog(self, "show:", "", showliste) chos.SetSelections(range(len(showliste[:-1]))) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(chos) self.SetSizerAndFit(hbox) if __name__ == "__main__": app = wx.App(0) Mainframe(None, -1, "Mainframe") app.MainLoop()And two questions:
First and more important, why is the choicebox not shown? I simply get an empty window.
Second, how to make SetMinSize and SetMaxSize doing something, in the best case even influencing the panelsize? Actually, they just seem to do... nothing.