-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfbrowse.c
34 lines (22 loc) · 1.06 KB
/
fbrowse.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**************************************************************************************************
fbrowse.c - File-Browser widget test. This demonstrates the use of Otk's built-in
file-selector widget. It is a simple stand-alone program.
Comple with:
cc -I/usr/X11R6/include -L/usr/X11R6/lib fbrowse.c -lGLU -lGL -lXmu -lXext -lX11 -lm -o fbrowse.exe
**************************************************************************************************/
#include "otk_lib.c"
char directory[500]=".", wildcards[500]="", filename[500]="";
void my_file_answer( char *filename ) /* Print name of selected file. */
{
printf("Browsing returned file-name: '%s'\n", filename );
}
void browsetest() /* Invoke the File Selection Browser. */
{
Otk_Browse_Files( "File to Open:", 500, directory, wildcards, filename, my_file_answer );
}
main( int argc, char **argv )
{
OtkInitWindow( 620, 540, argc, argv ); /* Open a window. */
OtkMakeButton( OtkOuterWindow, 20.0, 40.0, 60.0, 20.0, "Select File(s)", browsetest, 0 );
OtkMainLoop();
}