A Traceback? From where could I get that?
There is no error. Everything looks fine... except that in the case of the both shown defs, the one is exectued instead of the other.
I can add other menu items, they are okay. Only those both mix up.
Edit:
It'S the same without sid and rid. They were a 'remainder' of my attempts to find an access to the problem.
There is no error. Everything looks fine... except that in the case of the both shown defs, the one is exectued instead of the other.
I can add other menu items, they are okay. Only those both mix up.
Edit:
It'S the same without sid and rid. They were a 'remainder' of my attempts to find an access to the problem.
# -*- coding: cp1252 -*- import wx zd = Zeigedict = {"zeigspalten": ["A", "B"], "zeigreihen": ["a", "b"]} class Mainframe(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title) self.dpbox = dpbox = wx.BoxSizer(wx.HORIZONTAL) self.SetSizer(dpbox) # # # Teil 2: Menubalken menuBar = wx.MenuBar() setzenMenu = wx.Menu() setzenMenu.Append(wx.ID_ANY, "Spalten", "Spaltengruppen setzen") wx.EVT_MENU(self, wx.ID_ANY, self.OnZeigspalten) setzenMenu.Append(wx.ID_ANY, "Reihen", "Reihengruppen setzen") wx.EVT_MENU(self, wx.ID_ANY, self.OnZeigreihen) menuBar.Append(setzenMenu, "Setzen") self.SetMenuBar(menuBar) self.Show() def OnZeigspalten(self, event): self.spalcmbb = spalcmbb = wx.MultiChoiceDialog(self, "Spaltenauswahl nach Gruppen", "Spaltenauswahl nach Gruppen", zd["zeigspalten"]) if (spalcmbb.ShowModal() == wx.ID_OK): spaltenwahl = spalcmbb.GetSelections() print "gewählt sind Spalten: ", spaltenwahl print "-> ", for sw in spaltenwahl: print zd["zeigspalten"][sw], ", ", print spalcmbb.Destroy() return def OnZeigreihen(self, event): self.reihcmbb = reihcmbb = wx.MultiChoiceDialog(self, "Reihenauswahl nach Gruppen", "Reihenauswahl nach Gruppen", zd["zeigreihen"]) if (reihcmbb.ShowModal() == wx.ID_OK): reihenwahl = reihcmbb.GetSelections() print "gewählt sind Reihen: ", reihenwahl reihcmbb.Destroy() return if __name__ == "__main__": app = wx.App(0) preframe = Mainframe(None, -1, "Anfangsauswahl") app.MainLoop()