Re: Scotty with Tk (wish)

Thorsten Geelhaar (tgeelhaa@funghi.Materna.DE)
Fri, 04 Oct 1996 12:06:22 +0200

You wrote :

>I am a little new to Scotty. Is it possible to use scotty with wish? I have

>no need for the tkined. In fact, really just want to use the sunrpc command
>with my graphical app.

My answer :

Yes it is very ease .
You must only exchange the function Tcl_AppInit with following
in a copy of scotty.c . For example (so call i) scwish.c

int
Tcl_AppInit(interp)
Tcl_Interp *interp;
{
if (Tcl_Init(interp) != TCL_OK) {
return TCL_ERROR;
}

if (Tk_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}

Tcl_StaticPackage(interp, "Tk", Tk_Init, (Tcl_PackageInitProc *) NULL);

if (Tcl_PkgRequire(interp, "scotty", "2.1.0", 1) == NULL) {
Tcl_AppendResult(interp, "\n",
"This usually means that you have to define the TCLLIBPATH environment\n",
"variable to point to the tnm library directory or you have to include\n",
"the path to the tnm library directory in Tcl's auto_path variable.",
(char *) NULL);
return TCL_ERROR;
}

Tcl_SetVar(interp, "tcl_rcFileName", "~/.scwishrc", TCL_GLOBAL_ONLY);
return TCL_OK;
}

Now you can make a copy of the makefile of scotty.
Reduce all to scotty . Exchange scotty with scwish.
And include the library for TK.

A BAD example for it is my Makefile (see above) . I was to lazy to make it
clean. But it works .

only the important lines :

scwish: tnm$(SHLIB_SUFFIX) ntping straps scwish.o
$(LD) $(LD_FLAGS) -o scwish scwish.o $(TK_LIB_SPEC) \
$(TCL_LIB_SPEC) $(OSIMIS_LIBS) $(MSQL_LIB) $(GDMO_LIBS) \
-L/usr/openwin/lib -lX11 $(LIBS) $(DL_LIBS) -lm

scwish.o: $(UNIX_DIR)/scwish.c
$(CC) -c $(TNM_CC_SWITCHES) -I. -I$(TNM_GENERIC_DIR) $(TCL_INCLUDES) \
$(TK_INCLUDES) $(UNIX_DIR)/scwish.c

Have a lot of fun with it.

PS: Sorry for my bad english

ciao Thorsten

- -----------------------------------------------------------------
Thorsten Geelhaar Telefon: +49 231 5599 399 |\/\/\/|
Dr. Materna GmbH Fax : +49 231 5599 100 | |
| |
Vosskuhle 37 e-mail : Thorsten.Geelhaar@materna.de | (o)(o)
C _)
D-44141 Dortmund GERMANY | ,___|
| /
"We're all mad here. I'm mad, You're mad." /____\
"How do you know I'm mad?" said Alice.
"You must be" said the Cat, "or you wouldn't have come here."

- ------------------------------------------------------------------