Subject: Re: [SWIPL] How may I leave a PCE window available for input while a server is running on it?

From: Jan Wielemaker <[email-masked]>
Date: Wed, 26 Sep 2001 16:53:28 +0200

On Mon, 13 Aug 2001, Armando Stellato wrote:
>Hi,
>I'm writing a Prolog-server on windows, so I can't use multitasking.
>The problem is: if i make the server listening for inputs, he is busy
>and I cannot access the window (the pointer is in the classic sand glass
>shape). I'm using a repeat-loop to open a repetition of 0.55ms time
>cells where the server is listening for clients. If I could add
>something between the time cells for make the window listening for
>manual inputs, the problem would be solved, but I don't know what.
>Thank u in advance.

You can clear the busy cursor using send(Frame, busy_cursor, @nil) and
invoke send(@display, synchronise) from your loop to make the system
look for events.  This call processes pending GUI events (if any) and
returns immediately after doing so.

This kind of programming is a bit nastly though.  Multi-threading or
using multiple communicating Prolog applications probably gives more
reliable results.  For example you could use one Prolog process doing
the server work and control that from another doing the GUI work and
contacting the server just like to other clients.

	Regards --- Jan