Skip to content Skip to sidebar Skip to footer

Python 2.7.x Tkinter Popup Menu Throwing Tclerror

I'm trying to create a popup menu in Tk, but when I get to the part where the menu is to be displayed (menu.post), I get a 'TclError' exception. I don't understand why, and when I

Solution 1:

Ok. I think that you have to assign the menu to the root window. To do this add the line self.config(menu=self.menu). Other wise you are calling the menu without it having a window to display on.

Edit

Also it can't be set to overrideredirect because it does not support popup menus. It also gives an error if you right click on the window when it is not in focus.

Hope this helps!

Post a Comment for "Python 2.7.x Tkinter Popup Menu Throwing Tclerror"