1482ed561d8384240cc7280b81a714cd53c1d9da
2 * Author: Len Trigg <trigg@cs.waikato.ac.nz>
6 Update: Franck Wolff <frawolff@club-internet.fr>
7 -----------------------------------------------------------------------
8 List of updated functions :
10 add -s option for a save panel...
11 -----------------------------------------------------------------------
16 #include <WINGs/WINGs.h>
42 " -s\t\tSave panel (default open panel)\n"
43 " -i <str>\tInitial directory (default /)\n"
44 " -t <str>\tQuery window title (default none)\n"
47 "\t%s pops up a WindowMaker style file selection panel.\n"
51 ,ProgName
,ProgName
,__DATE__
56 #define OPEN_PANEL_TYPE 0
57 #define SAVE_PANEL_TYPE 1
59 int main(int argc
, char **argv
)
61 Display
*dpy
= XOpenDisplay("");
70 int panelType
= OPEN_PANEL_TYPE
;
75 puts("could not open display");
79 WMInitializeApplication("WMFile", &argc
, argv
);
83 while((ch
= getopt(argc
, argv
, "si:ht:")) != -1)
87 panelType
= SAVE_PANEL_TYPE
;
99 for(; optind
<argc
; optind
++)
102 scr
= WMCreateSimpleApplicationScreen(dpy
);
106 pixmap
= WMCreatePixmapFromXPMData(scr
, GNUSTEP_XPM
);
107 WMSetApplicationIconPixmap(scr
, pixmap
);
108 WMReleasePixmap(pixmap
);
109 if (panelType
== SAVE_PANEL_TYPE
) {
110 sPanel
= WMGetSavePanel(scr
);
111 if (WMRunModalFilePanelForDirectory(sPanel
, NULL
, initial
,
112 /*title*/ NULL
, NULL
) == True
)
113 printf("%s\n", WMGetFilePanelFileName(sPanel
));
117 oPanel
= WMGetOpenPanel(scr
);
118 if (WMRunModalFilePanelForDirectory(oPanel
, NULL
, initial
,
119 /*title*/ NULL
, NULL
) == True
)
120 printf("%s\n", WMGetFilePanelFileName(oPanel
));