|
From: Daniel A. S. <st...@ic...> - 2001-02-10 16:54:07
|
At 17:47 +0200 on 10/2/01, Mats Bengtsson wrote:
>Since I posted the bug, I can fill in some more. Actually, I tried
>to dig into it a few days ago:
>
>[info script] just returns the value in 'interp->scriptFile'.
>scriptFile is initially set to NULL, but in Tcl_EvalFile(..., fileName),
>scriptFile = fileName, and then the fileName is sourced in and evaluated.
>When finished, scriptFile is set to the value it had before.
>The source command actually calls Tcl_EvalFile(..., fileName).
>(in tclCmdMZ.c file)
>When doing source from the console, everything seems to work alright.
>
>However, the source from the menu command calls the 'SourceDialog()'
>function in tk/mac/tkMacMenus.c file, and the SourceDialog() function first
>calls Tcl_Eval("tk_getOpenFile") then Tcl_EvalFile(..., fileName).
>
>Note that the script based console in tk/library/console.tcl seems to
>work Ok,
>at least if you just evaluate the script associated with the source menu.
>This method is not used in the current version of MacTk.
>
>I don't understand what is going wrong here, but this is the flow of calls.
I had a look today and couldn' figure it out either from looking at
the code, the only thing I could think of is that somehow the second
Tcl_Eval* in SourceDialog ends up not setting scriptFile correctly.
(why?)
I'll try stepping through the code with the debugger next week when I
find some time.
--
** Daniel A. Steffen ** "And now to something completely
** Department of Mathematics ** different" Monty Python
** Macquarie University ** <mailto:st...@ma...>
** NSW 2109 Australia ** <http://www.maths.mq.edu.au/~steffen/>
|