title: Ruby (Shoes) - Wait for function to return value
body: <p>I have a function that presents the user a combo-box.</p>
  
  <pre><code>def select_interface(interfaces)
    list_box :items =&gt; interfaces do |list|
      interface = list.text
    end
    ### ideally should wait until interface has a value then: ###
    return interface
  end
  </code></pre>
  
  <p>The rest of the program depends on the selection from this combo-box.</p>
  
  <p>I would like to find a way to make ruby wait for the input from the combo-box and then carry executing the rest of the code.</p>
  
  <p>There is a similar function in <a href="http://shoooes.net" rel="nofollow noreferrer">shoes</a> called <strong><a href="http://help.shoooes.net/Built-in.html#ask" rel="nofollow noreferrer">ask</a></strong> that will wait for the input of the user.</p>
  
  <pre><code>interface =  ask("write your interface here")
  </code></pre>
  
  <p>How can I implement this "wait until the variable has a value" function in Ruby/shoes?</p>