Path: utzoo!utgpu!attcan!uunet!mcvax!ukc!stl!stc!datlog!torch!gary
From: gary@torch.UUCP (Gary Henderson)
Newsgroups: comp.windows.x
Subject: Xtk string to pixmap converter problem
Message-ID: <205@torch.UUCP>
Date: 5 Aug 88 15:54:51 GMT
Reply-To: gary@torch.co.uk (Gary Henderson)
Organization: TORCH Computers Ltd., Cambridge, United Kingdom
Lines: 23

I am trying to write a string to pixmap converter for the X-toolkit so users
can specify background bitmaps for widgets from .Xdefaults files.

Two problems:

1) I need two colours to use when converting a bitmap file into a pixmap.  I
   can use the widget's background colour for one but what do I use for the
   other colour ? Some widgets have a foreground colour but this hasn't been
   set when the background string to pixmap conversion is required.  I can't
   use the main application colours either (using XtGetApplicationResources)
   as these haven't been set if the converter is called for the
   application's toplevel widget.

2) Once a given string has been converted into a pixmap, the resource
   converter manager caches the result (the pixmap XID) and will not call
   my routine again with the same string.  Unfortunately, a core widget frees
   its background pixmap when it is being destroyed, so if several widgets
   use the same background pixmap and widgets are being created and destroyed,
   you end up with "Parameter is not a pixmap" errors from the server when a
   widget tries to select a pixmap XID as its background, an XID that some
   other widget has just freed when it got destroyed !

PLEASE HELP !