Logged In: YES
user_id=33229
Sorry for the lack of detail: the logic is wrong because the version number
of Tix is assumed to be the same as the version number of Tcl in _tkinter.
Right now they are different (8.3 or 8.4 for Tcl and 8.1 for Tix) and in general
these days with stubs in Tcl, they are unrelated. Any Tix should work with any
Tcl after Tcl 8.1 or so. So the answer is to remove tix from the for loop, and just
copy the Tcl block of logic and change the tcl to tix as in the following (untested)
if not os.environ.has_key("TIX_LIBRARY"):
for name in os.listdir(prefix):
if name.startswith("tix"):
tixdir = os.path.join(prefix,name)
if os.path.isdir(tixdir):
os.environ["TIX_LIBRARY"] = tixdir
del tixdir
Note that as it stands now there is a subtle difference between the logic for
setting TCL_LIBRARY and for setting TK_LIBRARY (ignoring tix completely).
Imagine you have a Tcl directory with no environment variables and the following subdirs:
tcl8.3 tcl8.4 tk8.3 tk8.4
If os.listddir returns the directories in alphabetical order I think you end up with
TCL_LIBRARY=.../tcl8.4 (there's no break in the for name loop)
and TK_LIBRARY=.../tk8.3 if tk was compiled with tcl 8.3 (_tkinter.TCL_VERSION)
With Tk8.4 now finally released this a real potential scenario.
This may be good or bad - the attached file maintains it.
The discussion above and the attached file applies to all versions of Python,
so it should be tagged for any 2.x branch. I think the same is true for Tix.py.
|