Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!ukc!icdoc!syma!jonm From: jonm@syma.sussex.ac.uk (Jonathan Meyer) Newsgroups: comp.windows.x Subject: Pixmap size Message-ID: <3254@syma.sussex.ac.uk> Date: 14 Aug 90 14:09:07 GMT Organization: University of Sussex Lines: 23 I want to add a converter in Xt for the backgroundPixmap, that takes a string (bitmap file) and creates a pixmap of the correct depth for the window, with two colours (foreground and background). This is much harder than it seems! Because there is no foreground_pixel in the Core widget, I can't think of a good way of doing this - when the converter is being run it doesn't know what foreground colour to use, because the foreground resource hasn't been set yet. All it can do is create a black and white pixmap. One solution would be for the converter to create a pixmap of depth one (ie a bitmap), and the widget initialize procedure to then turn this bitmap into a pixmap of the correct depth and colours. The difficulty with this is that the initialize procedure doesn't know the width and height of the bitmap so it can't easily convert it to a pixmap of the same size, but with a different depth. Can someone tell me of an easy way to solve this ? Is there some (undocumented) technique for finding the size of a pixmap? Or is there some other clever trick I can employ? At the moment, I am resorting to using a hash table keyed on pixmaps, storing their dimensions. Of course, this hash table is only examined for widgetclasses that I have written, so the converter is useless for any other widgetclasses :-( Jon.