title: Event listeners with Scala continuations
body: <p>Suppose I have to write some GUI code as follows:</p>
  
  <pre><code>widget1.addListener(event1 =>
     handle1(event1)
     widget2.addListener(event2 =>
       handle2(event2)
       widget3.addListener(event3 => handle3(event3))
     )
  )</code></pre>
  
  <p>How would you write it in CPS-style using Scala continuations? </p>