title: Waiting for seperate Toplevel class to set variable
body: <p>Im new to python and started to create a gui with tkinter. My code works fine for usage in one class. But to have a good structure i want to put all Toplevels into an own class. Im facing following problem:
  The function whatever in class A is creating a toplevel with options listed in a combobox via another class. I want to wait for an option to be selected until the following code in function whatever is execetued. But this doesnt work.
  I was trying around with loops, threads and tkinter to solve this problem, but it didnt work.
  I dont even now which way is right..</p>
  <pre><code>class OptionWindow:
      def __init__(self, root, options, option)
          #Toplevel with Combobox &amp; Options
          self.option = option
          button = Button(toplevel, text = &quot;Select&quot;, command=self.get_option)
  
      def GetOption(self):
          self.option = combobox.get
          if self.option !=&quot;&quot;:
              toplevel.destroy()
  
  class A:
      def __init__(self, root):
          # GUI with Labels, TreeView, Buttons.. 
          self.options = [A,B,C,D]
          self.option = &quot;&quot;
  
      def whatever(self):
          OptionWindow(self.root, self.options, self.option)
          #How to wait till self.option != &quot;&quot; ?
          print(&quot;Option: &quot;,option)
          # continuing code were option is used
  </code></pre>
  <p>while loop till var is set: TopLevel pops up, but without combobox|
  thread with flag: not even the toplevel is showing up|
  tkinter wait variable, doesnt work ether, but im not sure how to use it correctly</p>