From f.todescato@larisys.fr Thu Nov 29 16:53:58 2001
Received: from mx2.call.oleane.net (mx2.call.oleane.net [194.2.20.13])
	by swi.psy.uva.nl (8.10.2+Sun/8.11.2) with ESMTP id fATFrwf13990
	for <prolog@swi.psy.uva.nl>; Thu, 29 Nov 2001 16:53:58 +0100 (MET)
Received: from gradian  ([217.109.164.148])  by mx2.call.oleane.net  with SMTP id fATFruW02618 for <prolog@swi.psy.uva.nl>; Thu, 29 Nov 2001 16:53:56 +0100
Received: from 192.168.1.17 by gradian (InterScan E-Mail VirusWall NT); Thu, 29 Nov 2001 16:52:01 +0100
Received: by servcom.larisys.france with Internet Mail Service (5.5.2653.19)
	id <X289W41D>; Thu, 29 Nov 2001 16:52:45 +0100
Message-ID: <0D871E2C396E7A44B47CB01EC05664A70C818D@servcom.larisys.france>
From: Fabien Todescato <f.todescato@larisys.fr>
To: "'prolog@swi.psy.uva.nl'" <prolog@swi.swi.psy.uva.nl>
Date: Thu, 29 Nov 2001 16:52:45 +0100
Return-Receipt-To: Fabien Todescato <f.todescato@larisys.fr>
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
	charset="iso-8859-1"
Subject: [SWIPL] Displaying icons with XPCE - Windows platform

Dear XPCErs,

With XPCE 5.1.9 running under WNT4.0, I have the following problem when
trying to load and display icons held in '.ico' files :

00 ?- new(P,picture).
01
02 P = @789847/picture
03
04 Yes
05 ?- send($P,open).
06
07 Yes
08 ?- new(B,bitmap('X:/00222.ico')).
09
10 B = @805430/bitmap
11
12 Yes
13 ?- send($P,display,$B,point(48,48)).
14
15 Yes
16 ?- [PCE fatal: x:/00222.ico: Xopen failed on @display/display
17         in:     <No exception goal>
18 ]
19         <No goal>
20 Host stack:
21       [1] '$toplevel'
22 % Execution Aborted
23 ?- send($B,cursor(fleur)).
24
25 Yes
26 ?- send($B,recogniser,move_gesture(left)).
27
28 Yes

As you can see, I get an exception when trying to display the bitmap in the
picture. The bitmap is not displayed in the windows at first, but appears as
expected when the window undergoes a refresh, when resized, for example.

The bitmaps behaves afterwards in the expected manner, a cursor can be
specified on it, a recogniser can be attached to it, and so on...

As of now, I guess wrapping the icon display within an appropriate exception
handler is a possible workaround, but this does not solve the problem of the
icon not being immediately displayed in the picture. Another workaround is
to convert the .ico into a .bmp that will be correctly loaded, but then the
transparency mask of the icon is lost.

Has anyone else come across that problem already, and are more satisfying
workarounds known ?

Thanks a lot, Fabien TODESCATO

