title: Tkinter Option Menu Variable.get() method not returning selected element
body: <p>I have some problems with Tkinter, I want so retrieve the selected item of an option menu when pressing a button, but when testing the funcionality with a small testfuntion 'getdataset', I only get the predefined datavariable ('Birthdata') as an output so it seems that the datavariable.get() method is not returning the selected option in the optionmenu. I have looked everywhere but cannot seem to find the answer. Any help is appreciated.</p>
  
  <p>Code with option menu</p>
  
  <pre><code>root = Tk()
  root.configure(background='white')
  def getdataset():
      print(datavariable.get())
  
  datavariable = StringVar(root)
  datavariable.set('Birthdata')
  PickData = OptionMenu(root, datavariable,'Birthdata', 'Marriagedata', 'Deathdata',command=getdataset)
  PickData.grid(column=1,columnspan=2,row=1)
  </code></pre>
  
  <p>Code to initialize test function with button click:</p>
  
  <pre><code>wordcloud = Button(root, text = 'Word Cloud', bg='white', width=20, height = 5, command=getdataset)
  </code></pre>
  
  <p>Output after multiple button clicks:</p>
  
  <pre><code>Birthdata
  Birthdata
  Birthdata
  </code></pre>
  
  <p>I w</p>