Re: [tkined] Scotty 2.1.6 and Tk8.0

Juergen Schoenwaelder (schoenw@gaertner.de)
Tue, 26 Aug 1997 18:45:23 +0200

David Engel <david@sw.ods.com> said:

David> I'm trying to use Tnm 2.1.6 with Tcl/Tk 8.0. In limited testing, Tnm
David> appears to work fine with plain Tcl. However, problems occur when
David> trying to use Tnm with Tk. Tnm's undocumented event command conflicts
David> with Tk's own event command. Simply removing Tnm's event command
David> results in a segmentation violation when Tnm is loaded.

David> Does anyone know how to get around this problem? I'd prefer to not
David> have to go back to Tcl/Tk 7.6/4.2 since we are upgrading other
David> applications to Tcl/Tk 8.0.

Below is a patch that hopefully solves the problem. It just checks
whether event command already exists before defining the undocumented
event command of the Tnm extension. This seems to solve the problem if
your scripts do not rely on the undocumented Tnm event command, which
will be removed anyway in 2.2.0. I will probably release a 2.1.7
version with this and other minor fixes. Let me know if you experience
other problems while moving to 8.0 so that I can track them.

Juergen

*** /tmp/scotty-2.1.6/tnm/generic/tnmInit.c Wed Oct 23 09:12:17 1996
--- tnm/generic/tnmInit.c Tue Aug 26 18:36:41 1997
***************
*** 258,265 ****
InitSafeCmds(interp)
Tcl_Interp *interp;
{
! Tcl_CreateCommand(interp, "event", Tnm_EventCmd,
! (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
Tcl_CreateCommand(interp, "job", Tnm_JobCmd,
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
}
--- 258,269 ----
InitSafeCmds(interp)
Tcl_Interp *interp;
{
! Tcl_CmdInfo info;
!
! if (Tcl_GetCommandInfo(interp, "event", &info) == 0) {
! Tcl_CreateCommand(interp, "event", Tnm_EventCmd,
! (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
! }
Tcl_CreateCommand(interp, "job", Tnm_JobCmd,
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
}

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.