title: Tkinter window event <Visibility>
body: <p>I tried to get an event if the windows visibility is changed.
  I found out that there is an event called "Visibility".
  The Operating System is Windows 64bit.
  So I implemented in the following way:</p>
  
  <pre><code>root.bind('&lt;Visibility&gt;', visibilityChanged)
  </code></pre>
  
  <p>But I always got the state "VisibilityUnobscured" no matter if there is a window over it or not. What is the normal behaviour of this event? How can I implement a feature like that?</p>
  
  <p>Example Prog:</p>
  
  <pre><code>import tkinter as tk
  
  class GUI:
      def __init__(self, master):
          self.master = master
          master.title("Test GUI")
          self.master.bind('&lt;Visibility&gt;', self.visibilityChanged)
          self.label = tk.Label(master, text="GUI")
          self.label.pack()
  
          self.close_button = tk.Button(master, text="Close", command=master.quit)
          self.close_button.pack()
  
      def visibilityChanged(self, event):
          if (str(event.type) == "Visibility"):
              print(event.state)
  
  root = tk.Tk()
  my_gui = GUI(root)
  root.mainloop()
  </code></pre>