[REBOL] Re: A better way?
From: greggirwin:mindspring at: 6-Feb-2003 16:30
Hi Terry,
TB> I just used the server monitor as an example of launching "forever" loops
TB> from within the main window. What I don't understand is how you can do a
TB> forever loop after doing the view/new window? Or if calling forever loops
TB> with a button from within the main window is the most efficient way of doing
TB> this.
If you use a FOREVER loop after VIEW/NEW, you need a WAIT in there.
Now, once you've got a WAIT in there (which is basically all DO-EVENTS
does), you don't want to have another loop with a WAIT inside *that*
going on inside your main loop. I.e. you don't want to call WAIT
recursively; bad things will happen.
TB> For example, "Handy Server Monitor Window" has a forever loop after the
TB> windwow call.. but the following example chokes??
You need a WAIT in your code to allow system events to be processed.
a: layout [b: box btn [print "test" unview halt]]
view/new a
forever [
prin "testing..."
either error? try [read http://www.rebol.com][
b/color: red show b
][
b/color: green show b
]
print "done!"
wait 10
]
-- Gregg