From jan@swi.psy.uva.nl Wed Sep 26 16:59:09 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f8QEx9v03395;
	Wed, 26 Sep 2001 16:59:09 +0200 (MET DST)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f8QEx9m19691;
	Wed, 26 Sep 2001 16:59:09 +0200
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: Armando Stellato <starred@tiscalinet.it>,
   SWI Mailing List <prolog@swi.psy.uva.nl>
Subject: Re: [SWIPL] How may I leave a PCE window available for input while a server is running on it?
Date: Wed, 26 Sep 2001 16:53:28 +0200
X-Mailer: KMail [version 1.0.29.2]
Content-Type: text/plain
References: <3B77BB2F.4F1B3E45@tiscalinet.it>
In-Reply-To: <3B77BB2F.4F1B3E45@tiscalinet.it>
MIME-Version: 1.0
Message-Id: <01092616590902.19526@gollem>
Content-Transfer-Encoding: 8bit

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

