[wxPython-users] Is there a way to ... ?

Belinda Randolph belindarandolph at sbcglobal.net
Wed Apr 4 18:34:01 PDT 2007


My code reads a file to get the MenuSections.  The file could have 4 or 5 or
6 menu sections.  My current code assumes 5 menu sections with no error
checking.  I would much rather have a for-loop to build add the variable
number of menus to my menubar.  I'm hoping there is something like an
"execute" statement.

Thanks,
Belinda


        menuBar.Append(menu0,'User')
        menuBar.Append(menu1,self.TL.MenuSections[0])
        menuBar.Append(menu2,self.TL.MenuSections[1])
        menuBar.Append(menu3,self.TL.MenuSections[2])
        menuBar.Append(menu4,self.TL.MenuSections[3])
        menuBar.Append(menu5,self.TL.MenuSections[4])
        self.menuBar = menuBar
        self.SetMenuBar(menuBar)





More information about the wxpython-users mailing list