3 * Author: Len Trigg <trigg@cs.waikato.ac.nz>
32 " -i <str>\tInitial directory (default /)\n"
33 " -t <str>\tQuery window title (default none)\n"
36 "\t%s pops up a WindowMaker style file selection panel.\n"
40 ,ProgName
,ProgName
,__DATE__
45 int main(int argc
, char **argv
)
47 Display
*dpy
= XOpenDisplay("");
58 WMInitializeApplication("WMFile", &argc
, argv
);
63 puts("could not open display");
66 while((ch
= getopt(argc
, argv
, "i:ht:")) != -1)
79 for(; optind
<argc
; optind
++)
82 scr
= WMCreateSimpleApplicationScreen(dpy
);
86 pixmap
= WMCreatePixmapFromXPMData(scr
, GNUSTEP_XPM
);
87 WMSetApplicationIconImage(scr
, pixmap
); WMReleasePixmap(pixmap
);
88 panel
= WMGetOpenPanel(scr
);
90 /* The 3rd argument for this function is the initial name of the file,
91 * not the name of the window, although it's not implemented yet */
92 if (WMRunModalOpenPanelForDirectory(panel
, NULL
, initial
, /*title*/ NULL
, NULL
) == True
)
93 printf("%s\n", WMGetFilePanelFileName(panel
));