Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!bionet!agate!ucbvax!alphalpha.com!nazgul From: nazgul@alphalpha.com (Kee Hinckley) Newsgroups: comp.windows.x.motif Subject: Re: PushButton Pixmap problems Message-ID: <901022120152.2760@alphalpha> Date: 22 Oct 90 16:01:52 GMT References: <9010221401.AA17882@osf.osf.org> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 37 > In version 1.1 the restriction on the directories for XmGetPixmap are > actually loser than this implies. First, the user can specify an > environment variable XBMLANGPATH which will be used to generate a set of > default paths. Second, XmGetPixmap will recognize an absolute path on a > Unix system (a path beginning with '/') and use that as the file to open. > Finally, the current working directory is always searched by default if > neither an absolute path or XBMLANGPATH are specified. If you have any > more questions on this please ask me. This is the same approach that XOpen took with the message catalog system and it has a flaw. Let's say I want to be nice to the user and let them override the default icon, so I don't give it a full path. However I store all of my application information in a particular directory. How do I reconcile those? I can't override the XBMLANGPATH because the user may have set it. If I use a full path then XBMLANGPATH won't be used. I can't require the user to put my directory in the environment variable. Ideally there should be a call to add a new directory to the search path - this makes life much easier. While I'm on the subject, there are a couple of other calls of use here. One is when I already have a pixmap and want to add it (with a name) to the cache. Another is to check and see if something is already in the cache. Finally, and more critically. For many of my dialogs I need to add a few buttons, so I use a selection dialog and add a child (be real nice if I could add a child to a message dialog - but anyway...). In those dialogs I want to use one of the standard icons. It took me a *long* time to figure out why most of the time the icons never showed up - but occasionally they would. It turns out that the icons are not put in the cache until the first time a message dialog is created. This really ought to be made more global. As it is I now have the following call at the beginning of my code: XtDestroyChild(XmCreateMessageBox(parent, "", NULL, 0)); It looks pretty silly, but it does the trick.