[Tkinter-discuss] Problems to show menubar

mkieverpy at tlink.de mkieverpy at tlink.de
Mon Nov 26 16:28:55 CET 2007

Hi Mathias,

you need to attach your menubar to a Toplevel window.
A simple Frame cannot have a menubar.
It works, if you change your code like this:

from Tkinter import *

class DistManager(Frame):
    def createMenuBar(self):
        kundenmenu=Menu(menubar, tearoff=0)
        kundenmenu.add_command(label="Kunden anzeigen")
        kundenmenu.add_command(label="Kunden anlegen")
        kundenmenu.add_command(label="Kunden bearbeiten")
        menubar.add_cascade(label="Kunden", menu=kundenmenu)


tk = Tk()
app.master.title("CCB- DistributionsManager")

The menu is attached to the master.
The master must be a widget that can have a menu, like
Tk itself or a Toplevel window.
Another method would be to derive DistManager
from Toplevel (haven't tried though).

Schöne Grüße,
Matthias Kievernagel (mkiever/at/web/dot/de)

More information about the Tkinter-discuss mailing list