Handling interface events and tcp connections.
[1/2] from: bga::bug-br::org::br at: 10-Dec-2003 11:01
Hello.
Back to my never-ending problems on using Rebol (hey, I am learning!), I
just hit another problem.
I have this Rebol program that connects to a server, waits for it (the
server) to send some data and when it receives this data it prints it. Now
I need to create a view interface for it. This interface will have a text
area and the data received will be sent to this text area.
The problem I need to solve is that I need to wait for data arriving from
the server and, at the same time, handle user interface events. For now I
used a timer in the text area to check for data available in the server
but that's not exactly a clean approach.
In resume, I guess I wwant some wait to wait at the same time on ports and
on user-interface events. Is that possible at all?
-Bruno
[2/2] from: nitsch-lists:netcologne at: 10-Dec-2003 18:09
Am Mittwoch 10 Dezember 2003 14:01 schrieb Bruno G. Albuquerque:
> Hello.
> Back to my never-ending problems on using Rebol (hey, I am learning!), I
<<quoted lines omitted: 9>>
> In resume, I guess I wwant some wait to wait at the same time on ports and
> on user-interface events. Is that possible at all?
Yes. Your script now:
lots of code
forever[ .. wait .. ]
Your code later
lots of code
view/new layout[ .. ]
forever[ .. wait .. ]
With view/new 'view does not block.
And 'wait has the event-processing inbuild, so when waiting events are
processed automatically. So gui stays alive.
The smarter way using port/awake i leave to others ;)
> -Bruno
-Volker
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted