[Pythonmac-SIG] Tkinter and Python 2.2

Kevin Walzer sw at wordtech-software.com
Wed Dec 22 05:54:59 CET 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew,

I'm cross-posting this to the MacPython list because a lot of your
questions are relevant there. The Mac/Tkinter bindings are maintained by
the MacPython developers, not the TkAqua maintainers, although they
require the TkAqua libraries.

Can any of the core MacPython developers take a look at this thread and
give us the Pythonic viewpoint on these questions? (hooking TkAqua and
Tkinter into an old version of Python for the Mac with undocumented,
proprietary modifications: what issues should he consider?)

- -----
<quote> I use Poser 5 for OS X which originally came out for PC in 2002
or so,
bundled with a modified Python that has hooks to Poser's undocumented API
(for getting and setting variables inside the Poser environment). The
Python functionality was part of a previous interim version from the days
of OS 9 (Poser Pro Pack was developed in the fall of 2000).

Unfortunately when they finally released the OS X version last year, it
came bundled with the same version of Python instead of hooking to OS X's
instance. PoserPython's exact source version is unknown right now but
presumably around 2.0 since it looks like the programmers have been afraid
to update it since its inclusion in late 2000.

Many Python scripts for Poser are starting to rely on TkInter... argh.

Assume I can get the engineers at Curious Labs to tell me what version of
Python PoserPython is based off.
Also assume the modifications aren't too grisly.

If I have the source code for TkAqua, can it be modified and recompiled as
a separate binary for PoserPython? [I'm guessing this is preferable to
trying to get one instance of TkAqua to work for both instances of Python]
Does it make any difference if I don't have any other instances of TkAqua
on my system?  </quote>


Message: 1
Date: Tue, 21 Dec 2004 09:24:14 -0800
From: Jeff Hobbs <jeffh at ActiveState.com>
Organization: ActiveState Corporation
To: "Daniel A. Steffen" <steffen at ics.mq.edu.au>
CC: Andrew Roazen <Andrew.Roazen at NAU.EDU>, tcl-mac at lists.sourceforge.net
Subject: Re: [MACTCL] Tk porting/backporting question

Daniel A. Steffen wrote:

|> I don't think there are many people here with experience of Tkinter
|> internals of the level required to answer your question, it might be
|> better to ask on a python list...


Errr ... you'd be surprised with what some of us have experience
with.   ;)

|> On 18/12/2004, at 6:49, Andrew Roazen wrote:
|>
|
|>>> what's the most feasible path to a substitute for Tkinter to work with
|>>> this modified Python 2.2?
|>>>
|>>> If it's the best solution, what are the issues backporting TkAqua to
|>>> Python 2.2? Is the binary portable enough as-is to be dropped into the
|>>> Poser Python library as a replacement?


The basic answer to your question is that it depends on whether
the Tkinter python code has any 2.3-isms in it.  While possible,
I don't think that it's likely.  That means it should be pretty
easy to drop into 2.2.  From the TkAqua side, it should all just
work.  Martin v Loewis (loewis at sf dot net) would be a good
person to verify if the recent Tkinter has any 2.3-isms.

As for binary drop-in replacement ... other dynamic languages
don't have the advantages of stubs and such, so you get down to
the C level of binary portability.  It all depends on what C
structures and functions might have changed.  In general though, I
would not consider that part drop in - you should recompile the C
component of Tkinter for 2.2.

- -- Jeff Hobbs, The Tcl Guy http://www.ActiveState.com/, a division of
Sophos --__--__--


Message: 2 Date: Tue, 21 Dec 2004 09:47:56 -0800 From: Jeff Hobbs
<jeffh at ActiveState.com> Organization: ActiveState Corporation To: Andrew
Roazen <Andrew.Roazen at NAU.EDU> CC: "Daniel A. Steffen"
<steffen at ics.mq.edu.au>, tcl-mac at lists.sourceforge.net Subject: Re:
[MACTCL] Tk porting/backporting question Andrew Roazen wrote:

|> At 07:55 PM 12/21/2004 +1100, Daniel A. Steffen wrote:
|
|>>>>> If it's the best solution, what are the issues backporting TkAqua to
|>>>>> Python 2.2? Is the binary portable enough as-is to be dropped into
|>>>>> the Poser Python library as a replacement?
|
|>
|> Okay, let me put the question another way before I take it to the
|> appropriate Python list. Is TkAqua an application, a library, or
|> something else?


~ From the point of view of Python/Tkinter, TkAqua is a library.
Tkinter has a small C shim that links against the Tcl/Tk
libraries.  When you import Tkinter, it loads Tcl/Tk and
wham-o ... instant UIs.

- -- Jeff Hobbs, The Tcl Guy http://www.ActiveState.com/, a division of
Sophos --__--__--


Message: 3 Date: Tue, 21 Dec 2004 11:20:39 -0700 From: Andrew Roazen
<Andrew.Roazen at NAU.EDU> Subject: Re: [MACTCL] Tk porting/backporting
question To: Jeff Hobbs <jeffh at ActiveState.com>, "Daniel A. Steffen"
<steffen at ics.mq.edu.au> Cc: tcl-mac at lists.sourceforge.net
- --Boundary_(ID_uRanME8mWzgDC7vxf4omSw) Content-type: text/plain;
charset=us-ascii; format=flowed At 09:24 AM 12/21/2004 -0800, Jeff Hobbs
wrote:

|>>>On 18/12/2004, at 6:49, Andrew Roazen wrote:
|>
|>>>>>what's the most feasible path to a substitute for Tkinter to work
with
|>>>>>this modified Python 2.2?
|>>>>>
|>>>>>If it's the best solution, what are the issues backporting TkAqua to
|>>>>>Python 2.2? Is the binary portable enough as-is to be dropped into
the
|>>>>>Poser Python library as a replacement?
|
|>
|>The basic answer to your question is that it depends on whether the
|>Tkinter python code has any 2.3-isms in it.


By "Tkinter python code" you mean PoserPython scripts, or code within the
Tkinter-Python glue? Assuming you meant the former, if PoserPython is a
slightly modified 2.2, I doubt the scripts have 2.3-isms.


|>While possible, I don't think that it's likely.  That means it should be
|>pretty easy to drop into 2.2.


Clue this poor newbie in a little more as to what this means in terms of
actually placing (and replacing) files in Poser's Python library (which
appears to be structured fairly normally).


|> From the TkAqua side, it should all just work.  Martin v Loewis (loewis
|> at sf dot net) would be a good person to verify if the recent Tkinter
has
|> any 2.3-isms.


Confused here... I thought TkAqua was a replacement for Tkinter.


|>As for binary drop-in replacement ... other dynamic languages don't have
|>the advantages of stubs and such, so you get down to the C level of
binary
|>portability.  It all depends on what C structures and functions might
have
|>changed.  In general though, I would not consider that part drop in - you
|>should recompile the C component of Tkinter for 2.2.


Clue me again -- Tkinter appears to be a self-contained library (in
Windows, at least). Is TkAqua not a replacement for Tkinter but another
layer on top of it/library?

- ----------
| Andrew Roazen, Web Development Specialist
| Cline Library, Northern Arizona University
|  928.523.6764 <http://www2.nau.edu/~ar24/aroazen.vcf>vCard

The opinions expressed are those of the guy who sits at this desk, not his
employers.




- --__--__--

Message: 4
Cc: Jeff Hobbs <jeffh at ActiveState.com>,
~        "Daniel A. Steffen" <steffen at ics.mq.edu.au>,
~        tcl-mac at lists.sourceforge.net
From: Jim Ingham <jingham at apple.com>
Subject: Re: [MACTCL] Tk porting/backporting question
Date: Tue, 21 Dec 2004 11:19:18 -0800
To: Andrew Roazen <Andrew.Roazen at NAU.EDU>

TkInter is a shared library that links to the Tcl & Tk shared
libraries.  It is loaded into the Python interpreter, and provides a
shim that python can use to create and manipulate the Windows, buttons,
etc that the Tcl/Tk shared libraries provide.

TkAqua is the name for the distribution of Tcl & Tk on Mac OS X that
uses the Aqua Toolkit.  It includes the Tcl & Tk shared libraries (as
well as the Wish Shell.app and some other bits).  So you have to build
a version of the TkInter shared library that uses the Tcl & Tk shared
libraries that come with TkAqua.

Jim

On Dec 21, 2004, at 10:20 AM, Andrew Roazen wrote:


|> At 09:24 AM 12/21/2004 -0800, Jeff Hobbs wrote:
|> On 18/12/2004, at 6:49, Andrew Roazen wrote:
|> what's the most feasible path to a substitute for Tkinter to work with
|> this modified Python 2.2?
|>
|> If it's the best solution, what are the issues backporting TkAqua to
|> Python 2.2? Is the binary portable enough as-is to be dropped into the
|> Poser Python library as a replacement?
|>
|> The basic answer to your question is that it depends on whether the
|> Tkinter python code has any 2.3-isms in it.
|>
|> By "Tkinter python code" you mean PoserPython scripts, or code within
|> the Tkinter-Python glue? Assuming you meant the former, if PoserPython
|> is a slightly modified 2.2, I doubt the scripts have 2.3-isms.
|>
|> While possible, I don't think that it's likely.  That means it should
|> be pretty easy to drop into 2.2.
|>
|> Clue this poor newbie in a little more as to what this means in terms
|> of actually placing (and replacing) files in Poser's Python library
|> (which appears to be structured fairly normally).
|>
|> From the TkAqua side, it should all just work.  Martin v Loewis
|> (loewis at sf dot net) would be a good person to verify if the recent
|> Tkinter has any 2.3-isms.
|>
|> Confused here... I thought TkAqua was a replacement for Tkinter.
|>
|> As for binary drop-in replacement ... other dynamic languages don't
|> have the advantages of stubs and such, so you get down to the C level
|> of binary portability.  It all depends on what C structures and
|> functions might have changed.  In general though, I would not consider
|> that part drop in - you should recompile the C component of Tkinter
|> for 2.2.
|>
|> Clue me again -- Tkinter appears to be a self-contained library (in
|> Windows, at least). Is TkAqua not a replacement for Tkinter but
|> another layer on top of it/library?
|> Andrew Roazen, Web Development Specialist | Cline Library, Northern
|> Arizona University | $B,6(B 928.523.6764 vCard
|>
|> The opinions expressed are those of the guy who sits at this desk, not
|> his employers.



- --__--__--

Message: 5
From: "Jeff Hobbs" <jeffh at ActiveState.com>
To: "'Andrew Roazen'" <Andrew.Roazen at NAU.EDU>,
~        "'Daniel A. Steffen'" <steffen at ics.mq.edu.au>
Cc: <tcl-mac at lists.sourceforge.net>
Subject: RE: [MACTCL] Tk porting/backporting question
Date: Tue, 21 Dec 2004 11:26:39 -0800
Organization: ActiveState

Andrew Roazen wrote:

|>>> The basic answer to your question is that it depends on
|>>> whether the Tkinter python code has any 2.3-isms in it.
|
|>
|> By "Tkinter python code" you mean PoserPython scripts, or
|> code within the Tkinter-Python glue? Assuming you meant


I meant the Tkinter-Python glue.  The C part is rather thin,
but there is a lot of python code on top as they have their
own megawidget system and such (pmw).  Parts of this may
have 2.3-isms, as that included enhancements to the object
system, which may well be nice to use in a megwidget system.
The $PYTHON\Lib\lib-tk has a few 100KB of py code (that's
the Windows installed path ... unix is a bit different).


|>>> While possible, I don't think that it's likely.  That means
|>>> it should be pretty easy to drop into 2.2.


|> Clue this poor newbie in a little more as to what this means
|> in terms of actually placing (and replacing) files in Poser's
|> Python library (which appears to be structured fairly normally).


Just drop in the relevant bits and pray it works.  If you do
"find /path/to/python -name '*inter*'", that should reveal
the important Tkinter directories.


|> Confused here... I thought TkAqua was a replacement for Tkinter.


No, TkAqua is just Tk for the native Aqua toolkit (as opposed
to Tk for OS X/X, which was the original).  Tkinter is just
the python binding to Tcl/Tk to create Tk UIs.


|> Clue me again -- Tkinter appears to be a self-contained library
|> (in Windows, at least). Is TkAqua not a replacement for Tkinter
|> but another layer on top of it/library?


Er, that's not correct.  What they are doing is just copying
in the relevant Tcl/Tk code to make it work for them.

Jeff



- --
Cheers,

Kevin Walzer, PhD
WordTech Software--Open Source Applications and Packages for OS X
http://www.wordtech-software.com
http://www.smallbizmac.com
http://www.kevin-walzer.com
mailto:sw at wordtech-software.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFByP4iJmdQs+6YVcoRAjmaAJ0cy8HKvj7GypdOpqiBfacrRXIeBACdHDKe
ALlCWdfKpx+i4JJkggD4eds=
=Ctot
-----END PGP SIGNATURE-----


More information about the Pythonmac-SIG mailing list