title: Python3 Tkinter popup menu not closing automatically when clicking elsewhere
body: <p>I'm running Python 3.3.3 (and right now I'm on Ubuntu but I also develop on Mac and Windows, which I haven't yet tested). I have a Treeview object that responds to right click on items and shows a context menu depending on what you click... but I've noticed that if you right click somewhere else while the original menu is up, it just opens another one.</p>
  <p>In fact, normal clicking doesn't hide them either. Even when I close the window the menus still stay floating. The only way to get them to go away is to click one of the options.</p>
  <p>The end result is this:
  <img src="https://i.stack.imgur.com/UPzXd.png" alt="Context Menus EVERYWHERE" /></p>
  <p>My code for the menu is as follows:</p>
  <pre><code>def rightclick_listitem(self, event):
      rowitem = self.sources.identify('item', event.x, event.y)
  
      if rowitem == '':
          print('Right clicked an empty space.')
          return
      # user right clicked something.
      self.sources.selection_set(rowitem)
      rcmenu = Menu(self.root, tearoff=0)
      plugin_disabled=self.sources.item(rowitem, 'values')[0] == 'Disabled'
      if plugin_disabled:
          rcmenu.add_command(label='Plugin is disabled...',
                             command=self.plugin_disabled_click)
      rcmenu.add_command(label='Plugin options',state='disabled' if plugin_disabled else 'active')
      rcmenu.add_command(label='Uninstall plugin')
      rcmenu.post(event.x_root, event.y_root)
  </code></pre>
  <p>The code that calls this code is located here:</p>
  <pre><code>    #RIGHTMOUSE is a variable that changes based on OS due to the way Mac OSX works
      #sources is the treeview object
      self.sources.bind(RIGHTMOUSE, self.rightclick_listitem)
  </code></pre>
  <p>I googled around and only got some people asking the same question with no answers. I'm still somewhat new to tkinter and python in general, and didn't see anything about this. I bind other actions to the treeview as well.</p>
  <p>If you need more sourcecode my project is here: <a href="https://github.com/Mgamerz/Fresh-Set-of-Images" rel="nofollow noreferrer">https://github.com/Mgamerz/Fresh-Set-of-Images</a> (freshsetofimages.py)</p>
  <p>Any help is appreciated.</p>
  <p>And the plugins required to make this appear: <a href="https://github.com/Mgamerz/fsoi_plugins" rel="nofollow noreferrer">https://github.com/Mgamerz/fsoi_plugins</a></p>