I'm trying to porting a project 2to3 on python, and stuck in tkinter.
In python2, there is no problem with adding menu bar to Frame in tkinter,
but python3 occured attribute error. (Frame object has no attribute 'tk_menuBar')
Is there any differences between python2 and python3 about adding menu bar to Frame in tkinter?
class TkMap(Map, tkinter.Tk):
""" Map with Tkinter GUI functions """
def __init__(self, cols, rows, value,width, height, widthMM, heightMM,title, menu = None, keybindings = []):""" TkMap extends Map and Tkinter """Map.__init__(self, cols, rows, widthMM, heightMM)tkinter.Tk.__init__(self)self.title(title)if menu == None:menu = [('File',[['Exit',self.destroy]])]keybindings.append( ("<Configure>", self.changeSize))self.menuButtons = {}self.debug = 0self.application = 0self.width = widthself.height = heightself.colScale = self.width / self.colsself.rowScale = self.height / self.rowsself.addMenu(menu)def addMenu(self, menu):""" Create a menu """self.mBar = tkinter.Frame(self,relief=tkinter.RAISED,borderwidth=2)self.mBar.pack(fill=tkinter.X)*for entry in menu:self.mBar.tk_menuBar(self.makeMenu(self.mBar, entry[0],entry[1]))*self.mBar.pack(side = "top")
PS. It's my first question, so i will be appreciated that if you point out my mistake about bad manners.