title: The main GUI freezes and counting stops while clicking the menu bar buttons
body: <p>My problem is that when I click on the menu bar buttons, the counting in the main GUI window freezes until the the button is depressed. I have read a lot about threading and callback, after method but none of that helps to solve this problem. Unless I am missing something. Please let me know where the problem might be. Thanks!</p>
  
  <pre><code>from tkinter import*
  import time
  import _thread as thread
  
  def NewFile():
      print ("New File!")
  def OpenFile():
      showerror('Not implemented','Not yet available')
  def About():
      print ("This is a simple example of a menu")
  
  def my_func():
  
      for count in range(1000000):
  
          count = count + 1
  
          entry.delete(0,END)
          entry.insert(0, count)
          entry.update()  
  
  def menu(root):             
      menu = Menu(root)
      root.config(menu=menu)
      filemenu = Menu(menu)
      menu.add_cascade(label="File", menu=filemenu)
      filemenu.add_command(label="New", command=NewFile)
      filemenu.add_command(label="Open...", command=OpenFile)
      filemenu.add_separator()
      filemenu.add_command(label="Exit", command=root.destroy)
      helpmenu = Menu(menu)
      menu.add_cascade(label="Help", menu=helpmenu)
      helpmenu.add_command(label="About...", command=About)
  
  
  root = Tk()
  root.geometry("400x400")
  
  
  lab = Label(root, text="Date and Time", width=7, relief=SUNKEN, bg = "yellow", font = "times 16 bold")
  lab.pack(side=TOP, fill=X,  padx=5, pady=5)
  entry = (Entry(root, relief=SUNKEN, bg = "powder blue", fg="blue", justify='center', font = "times 16 bold"))
  entry.insert(0,"0")
  entry.pack(padx=5, pady=5)
  
  root.after(20, my_func)
  menu(root)  
  root.mainloop()
  </code></pre>