scl@sasha.acc.Virginia.EDU (Steve Losen) (04/23/91)
I have recently snarfed a program that uses the XmCreateFileSelectionDialog function. I'm no X or motif programmer, so please bear with me. I have determined that this call opens up a window that allows the user to type a pattern into a "filter" box, push the "Filter" button and a scrolled window fills with filenames matching the pattern. The user can then select a filename in the scrolled window and click the "OK" button to select the file. Then this widget disappears. This is very useful, but there's one problem -- whenever the widget pops up it is always initialized with a default pattern, usually forcing the user to retype his pattern. It would be much more convenient (in this application, at least) for the pattern to be saved between calls. In the code the default pattern string is being passed to XmCreateFileSelectionDialog. My question is this: Is there any way to get the user-modified pattern string back from this widget so that it can be passed to the next call to XmCreateFileSelectionDialog? Or is there some other way to get the behavior I want? This is on a IBM RS/6000 running AIX 3.1.3. Motif comes with the system, but I believe it is version 1.0 (based on X11.3). Please respond by email since I don't ordinarily read this group. -- Steve Losen scl@virginia.edu University of Virginia Academic Computing Center
slh@gibdo.engr.washington.edu (04/23/91)
In article <1991Apr22.220656.22475@murdoch.acc.Virginia.EDU> scl@sasha.acc.Virginia.EDU (Steve Losen) writes: [stuff] |This is very useful, but there's one problem -- whenever the widget |pops up it is always initialized with a default pattern, usually forcing |the user to retype his pattern. It would be much more convenient (in |this application, at least) for the pattern to be saved between calls. |In the code the default pattern string is being passed to |XmCreateFileSelectionDialog. My question is this: Is there any way to |get the user-modified pattern string back from this widget so that it |can be passed to the next call to XmCreateFileSelectionDialog? Or is |there some other way to get the behavior I want? | If instead of creating the widget every time you needed it, you just managed and unmanged it (which is probably a better thing to do anyway), the filter would be kept for you automatically, and so in fact you'd have to explicitely reset it if you want the default. If you actually wanted to create it every time, there is a resource you can query for to get the mask. (something like XmNdirMask or XmNdirSpec)