From 7fb60cfdbec60849fcebf551d78fdab2a5ebd49e Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 11 Mar 2013 11:46:03 +0400 Subject: [PATCH] 0023775: Compatibility with Tcl/Tk 8.6 --- src/Draw/Draw_Window.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Draw/Draw_Window.cxx b/src/Draw/Draw_Window.cxx index dfcf218d43..cd553921a7 100755 --- a/src/Draw/Draw_Window.cxx +++ b/src/Draw/Draw_Window.cxx @@ -79,7 +79,11 @@ defaultPrompt: errChannel = Tcl_GetStdChannel(TCL_STDERR); if (code != TCL_OK) { if (errChannel) { +#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 5))) + Tcl_Write(errChannel, Tcl_GetStringResult(Interp), -1); +#else Tcl_Write(errChannel, Interp->result, -1); +#endif Tcl_Write(errChannel, "\n", 1); } Tcl_AddErrorInfo(Interp, @@ -1086,7 +1090,11 @@ Standard_Boolean Init_Appli() mainWindow = Tk_MainWindow(interp) ; if (mainWindow == NULL) { +#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 5))) + fprintf(stderr, "%s\n", Tcl_GetStringResult(interp)); +#else fprintf(stderr, "%s\n", interp->result); +#endif exit(1); } Tk_Name(mainWindow) = @@ -2081,7 +2089,11 @@ static DWORD WINAPI tkLoop(VOID) Standard_Integer res = Tk_Init (interp); if (res != TCL_OK) { +#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 5))) + cout << "tkLoop: error in Tk initialization. Tcl reported: " << Tcl_GetStringResult(interp) << endl; +#else cout << "tkLoop: error in Tk initialization. Tcl reported: " << interp->result << endl; +#endif } } catch (Standard_Failure) @@ -2092,7 +2104,11 @@ static DWORD WINAPI tkLoop(VOID) mainWindow = Tk_MainWindow (interp); if (mainWindow == NULL) { +#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 5))) + fprintf (stderr, "%s\n", Tcl_GetStringResult(interp)); +#else fprintf (stderr, "%s\n", interp->result); +#endif cout << "tkLoop: Tk_MainWindow() returned NULL. Exiting...\n"; Tcl_Exit (0); }