Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Sticky Button Down State

From: maximo:meteorstudios at: 30-Jun-2003 16:42

Hi, here is my unsticky solution... with this example everything stays active... the last suggestion, if run, still jams the ui when I tested it. The code below is simplified, but the wait loop is the real issue. it tests to see if we are currently scanning and if the user presses start again, it opens a warning box... if you want to do it for multiple files just iterate on the do-start and add an argument to it for the file to browse. ========== rebol [] gui: layout [ button "start" [do-start] button "stop" [do-stop] ] user-cancel: false started: false do-start: does [ either not started [ started: true data: open/lines http://www.rebol.com user-cancel: false until [ print first data wait 0 if user-cancel [break] data: next data tail? data ] if tail? data [print "==== END OF FILE ===="] close data started: false ][ request/ok "==== ALREADY PRINTING ====" ] ] do-stop: does [ user-cancel: true started: false ] view gui ========== HTH -max