1
/* an executable to launch browsehelp.tcl
2
* by Matthieu PHILIPPE 01/01/2003
11
Tk_Window TKmainWindow=NULL;
14
char TkScriptpath[1000];
16
int main(int argc, char *argv[])
21
printf("browsehelpexe: 3 arguments are needed !\n");
24
if (getenv("SCI")==(char *)NULL)
26
printf("The SCI environment variable is not set.\nTK initialisation failed !\n");
29
strcpy(TkScriptpath, getenv("SCI"));
30
strcat(TkScriptpath, "/tcl/browsehelp.tcl");
32
#ifdef TCL_MAJOR_VERSION
33
#ifdef TCL_MINOR_VERSION
34
#if TCL_MAJOR_VERSION >= 8
35
#if TCL_MINOR_VERSION > 0
36
Tcl_FindExecutable(NULL);
42
interp = Tcl_CreateInterp();
44
if (Tcl_Init(interp) == TCL_ERROR)
48
if (Tk_Init(interp) == TCL_ERROR)
52
if (TKmainWindow == NULL)
54
TKmainWindow = Tk_MainWindow(interp);
55
XTKdisplay = Tk_Display(TKmainWindow);
56
XTKsocket = ConnectionNumber(XTKdisplay);
57
Tk_GeometryRequest(TKmainWindow,200,200);
58
Tcl_SetVar(interp, "manpath", argv[1],TCL_GLOBAL_ONLY);
59
Tcl_SetVar(interp, "Home", argv[2],TCL_GLOBAL_ONLY);
60
Tcl_SetVar(interp, "lang", argv[3],TCL_GLOBAL_ONLY);
61
Tcl_SetVar(interp, "SciPath",getenv("SCI") ,TCL_GLOBAL_ONLY);
62
Tcl_EvalFile(interp, TkScriptpath);
63
Tcl_Eval(interp, "wm withdraw .");
64
/*Tcl_Eval(interp, "catch {destroy $sciw}");*/
65
Tcl_Eval(interp, "wm protocol $sciw WM_DELETE_WINDOW exit;");
66
Tcl_Eval(interp, "proc quitapp {widget} {exit;}");
75
while (Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT)==1) {}