EventListener.st
changeset 2617 91adf98676da
parent 2516 d088b12a7948
child 2687 9d0bae89d82f
equal deleted inserted replaced
2616:98c4ab65ef38 2617:91adf98676da
   192     "process an event; if true is returned, the event is considered to be
   192     "process an event; if true is returned, the event is considered to be
   193      'eaten' by the listener, and not passed to the view.
   193      'eaten' by the listener, and not passed to the view.
   194      If false is returned, the event is processed as usual.
   194      If false is returned, the event is processed as usual.
   195      Here, the event is dispatched into one of the button*/key* etc. methods"
   195      Here, the event is dispatched into one of the button*/key* etc. methods"
   196 
   196 
       
   197     |eventHasBeenProcessed|
       
   198 
       
   199     eventHasBeenProcessed := false.
   197     Error handle:[:ex |
   200     Error handle:[:ex |
   198         ('Listener [info]: error while processing event: ' , ex description) infoPrintCR.
   201         ('Listener [info]: error while processing event: ' , ex description) infoPrintCR.
   199         ^ false
       
   200     ] do:[
   202     ] do:[
   201         ^ ev dispatchWithViewArgumentTo:self
   203         eventHasBeenProcessed := ev dispatchWithViewArgumentTo:self
   202     ]
   204     ].
       
   205     ^ eventHasBeenProcessed
   203 !
   206 !
   204 
   207 
   205 unlisten
   208 unlisten
   206     "uninstall myself as listener"
   209     "uninstall myself as listener"
   207 
   210 
   209 ! !
   212 ! !
   210 
   213 
   211 !EventListener class methodsFor:'documentation'!
   214 !EventListener class methodsFor:'documentation'!
   212 
   215 
   213 version
   216 version
   214     ^ '$Header: /cvs/stx/stx/libview2/EventListener.st,v 1.25 2008-07-09 12:20:38 fm Exp $'
   217     ^ '$Header: /cvs/stx/stx/libview2/EventListener.st,v 1.26 2009-03-23 18:54:46 cg Exp $'
   215 ! !
   218 ! !