[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Modules _tkinter.c,1.91,1.92

Peter Funk pf@artcom-gmbh.de
Wed, 29 Mar 2000 00:13:02 +0200 (MEST)


Hi!

Guido van Rossum:
> Modified Files:
> 	_tkinter.c 
[...]

> *** 491,501 ****
>   
>   	v->interp = Tcl_CreateInterp();
> - 
> - #if TKMAJORMINOR == 8001
> - 	TclpInitLibraryPath(baseName);
> - #endif /* TKMAJORMINOR */
>   
> ! #if defined(macintosh) && TKMAJORMINOR >= 8000
> ! 	/* This seems to be needed since Tk 8.0 */
>   	ClearMenuBar();
>   	TkMacInitMenus(v->interp);
> --- 475,481 ----
>   
>   	v->interp = Tcl_CreateInterp();
>   
> ! #if defined(macintosh)
> ! 	/* This seems to be needed */
>   	ClearMenuBar();
>   	TkMacInitMenus(v->interp);
> ***************

Are you sure that the call to 'TclpInitLibraryPath(baseName);' 
is not required in Tcl/Tk 8.1, 8.2, 8.3 ?  
I would propose the following:

+#if TKMAJORMINOR >= 8001
+ TclpInitLibraryPath(baseName);
+# endif /* TKMAJORMINOR */

Here I quote from the Tcl8.3 source distribution:
/*
 *---------------------------------------------------------------------------
 *
 * TclpInitLibraryPath --
 *
 *      Initialize the library path at startup.  We have a minor
 *      metacircular problem that we don't know the encoding of the
 *      operating system but we may need to talk to operating system
 *      to find the library directories so that we know how to talk to
 *      the operating system.
 *
 *      We do not know the encoding of the operating system.
 *      We do know that the encoding is some multibyte encoding.
 *      In that multibyte encoding, the characters 0..127 are equivalent
 *          to ascii.
 *
 *      So although we don't know the encoding, it's safe:
 *          to look for the last slash character in a path in the encoding.
 *          to append an ascii string to a path.
 *          to pass those strings back to the operating system.
 *
 *      But any strings that we remembered before we knew the encoding of
 *      the operating system must be translated to UTF-8 once we know the
 *      encoding so that the rest of Tcl can use those strings.
 *
 *      This call sets the library path to strings in the unknown native
 *      encoding.  TclpSetInitialEncodings() will translate the library
 *      path from the native encoding to UTF-8 as soon as it determines
 *      what the native encoding actually is.
 *
 *      Called at process initialization time.
 *
 * Results:
 *      None.
 */

Sorry, but I don't know enough about this in connection with the 
unicode patches and if we should pay attention to this.

Regards, Peter
-- 
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen)