On 14 May 2014 11:21, Alejandro Autalan <alejandroauta...@gmail.com> wrote:

> Here's an example: http://linkode.org/tE01VF7sGPOXjvsWymBqi4

Quoting http://linkode.org/about:

"It's a kind of short living collaboration space, a dynamic pastebin."

When communicating on a *public mailing list*, please include all
relevant information *in the email message* where possible, to
maintain the integrity of the message, and the list archive. This
shows consideration to present-day readers who may not have access to
other protocols like http, and also to readers of the list archive in
the future, when the backers of some transient pastebin site may well
have abandoned it.

import tkinter as tk

root = tk.Tk()

menu = tk.Menu(root)

mfile = tk.Menu(menu)
mfile.add_command(label='Option 1')

medit = tk.Menu(menu)
medit.add_command(label='Option2')

menu.add_cascade(label='File', menu=mfile)
menu.add_cascade(label='Edit', menu=medit, state=tk.DISABLED)

root.configure(menu=menu)

#cb
enabled = False
def on_button_click():
    global enabled
    if enabled:
        enabled = False
        menu.entryconfigure(2, state=tk.DISABLED)
    else:
        enabled = True
        menu.entryconfigure(2, state=tk.NORMAL)

#button
b = tk.Button(root, text='Enable', command=on_button_click)
b.grid(padx=60, pady=20)

root.mainloop()
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to