From 6a6d3284e86e6e0e635cd678424fe6ecf3d68d44 Mon Sep 17 00:00:00 2001 From: stanton Date: Sat, 6 Mar 1999 23:18:05 +0000 Subject: stubbed out TkConsoleCreate and added a call to TkConsoleCreate_ in Tk_Main() so that Tk can be dynamically loaded --- generic/tkConsole.c | 16 ++++++++++++++-- generic/tkMain.c | 4 ++-- mac/tkMacAppInit.c | 3 +-- win/winMain.c | 11 +---------- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/generic/tkConsole.c b/generic/tkConsole.c index 0ff1479..6f89c48 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkConsole.c,v 1.3 1999/02/04 20:51:36 stanton Exp $ + * RCS: @(#) $Id: tkConsole.c,v 1.3.4.1 1999/03/06 23:18:05 stanton Exp $ */ #include "tk.h" @@ -36,6 +36,7 @@ static Tcl_Interp *gStdoutInterp = NULL; */ void TkConsoleCreate _ANSI_ARGS_((void)); +void TkConsoleCreate_ _ANSI_ARGS_((void)); int TkConsoleInit _ANSI_ARGS_((Tcl_Interp *interp)); void TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp, int devId, char *buffer, long size)); @@ -79,7 +80,7 @@ static Tcl_ChannelType consoleChannelType = { /* *---------------------------------------------------------------------- * - * TkConsoleCreate -- + * TkConsoleCreate, TkConsoleCreate_ -- * * Create the console channels and install them as the standard * channels. All I/O will be discarded until TkConsoleInit is @@ -98,6 +99,17 @@ static Tcl_ChannelType consoleChannelType = { void TkConsoleCreate() { + /* + * This function is being disabled so we don't end up calling it + * twice. Once from WinMain() and once from Tk_Main(). The real + * function is now TkConsoleCreate_ and is only called from Tk_Main. + * All of is an ugly hack. + */ +} + +void +TkConsoleCreate_() +{ Tcl_Channel consoleChannel; consoleChannel = Tcl_CreateChannel(&consoleChannelType, "console0", diff --git a/generic/tkMain.c b/generic/tkMain.c index ffd9d8b..abbcb7b 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMain.c,v 1.2.4.1 1999/03/06 23:07:51 stanton Exp $ + * RCS: @(#) $Id: tkMain.c,v 1.2.4.2 1999/03/06 23:18:05 stanton Exp $ */ #include @@ -124,7 +124,7 @@ Tk_MainEx(argc, argv, appInitProc, interp) #if (defined(__WIN32__) || defined(MAC_TCL)) - TkConsoleCreate(); + TkConsoleCreate_(); #endif #ifdef TCL_MEM_DEBUG diff --git a/mac/tkMacAppInit.c b/mac/tkMacAppInit.c index 5b73a65..1870b7e 100644 --- a/mac/tkMacAppInit.c +++ b/mac/tkMacAppInit.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacAppInit.c,v 1.5 1999/02/04 20:57:18 stanton Exp $ + * RCS: @(#) $Id: tkMacAppInit.c,v 1.5.4.1 1999/03/06 23:18:05 stanton Exp $ */ #include @@ -274,7 +274,6 @@ MacintoshInit() Tcl_MacSetEventProc(TkMacConvertEvent); - TkConsoleCreate(); return TCL_OK; } diff --git a/win/winMain.c b/win/winMain.c index 12c9d34..d55f447 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: winMain.c,v 1.4 1999/02/04 20:57:18 stanton Exp $ + * RCS: @(#) $Id: winMain.c,v 1.4.4.1 1999/03/06 23:18:05 stanton Exp $ */ #include @@ -23,7 +23,6 @@ * interfaces are available for use, but are not supported. */ -EXTERN void TkConsoleCreate(void); EXTERN int TkConsoleInit(Tcl_Interp *interp); /* @@ -85,14 +84,6 @@ WinMain(hInstance, hPrevInstance, lpszCmdLine, nCmdShow) */ SetMessageQueue(64); - /* - * Create the console channels and install them as the standard - * channels. All I/O will be discarded until TkConsoleInit is - * called to attach the console to a text widget. - */ - - TkConsoleCreate(); - setargv(&argc, &argv); /* -- cgit v0.12