Just an FYI that Daniel Steffen has Tk now loadable from Tcl
on Aqua (required some thread voodoo). This also enables
Tcl::Tk on Aqua, with confirmation from the attached email.
Jeff Hobbs, The Tcl Guy
http://www.ActiveState.com/, a division of Sophos
-----Original Message-----
From: Daniel A. Steffen
Sent: Monday, September 27, 2004 2:51 AM
To: tcl mac; Jim Ingham
Cc: Wout Mertens
Subject: [MACTCL] loadable TkAqua
All,
the follwoing has been on my almost-finished pile for a while, finally
got around to cleaning it up this weekend:
http://sourceforge.net/tracker/index.php?
func=detail&aid=1035348&group_id=12997&atid=312997
this has patches to core-8-4-branch and HEAD that enable [package
require Tk] for TkAqua.
All platform specific code from tkMacOSXAppInit.c is moved to
tkMacOSXInit.c and tkMacOSXAppInit.c is removed and replaced by the
generic unix/tkAppInit.c.
Almost all such startup code was interp specific and is moved into the
existing initialization code in TkpInit(). The only
pre-interp-initialization we need to do is setting up the
Resources/Scripts/AppMain.tcl startup file (if present), this code is
moved to a new TkMacOSXDefaultStartupScript() which is called from
Tk_Main() (the only change to generic code).
The main project change is addition of a pkgIndex.tcl script in
Tk.framework/Resources/Scripts, which enables [package require Tk].
I've also added code to TkpInit() that checks if we are loaded into a
bundled executable; and if not, attempts to dynamically acquire the
undocumented CPSEnableForegroundOperation SPI and use it to notify the
window server that we are now a full GUI application (this will not
break if that SPI ever disappears or changes its name).
Even though we've previously discussed and rejected using CPS SPI, I've
lost my scruples on this after talking to the LaunchServices engineers
at WWDC (who said to go ahead and use the same workaround that JAR
launcher, SDL, wxPython etc all already use, it's not likely to go away
at this point and an official solution is not in the pipeline). Just
google for CPSEnableForegroundOperation to see how widespread use of
this SPI is... In any case, this code can be disabled via #define if
desired.
Of course it's still much preferred to use a bundled executable, as you
cannot get a dock icon, document bindings, a bundle id, etc otherwise,
also the aete resource for Wish is not available to an unbundled
executable (i.e. app cannot be targeted via AppleScript)
With all this, [package require Tk] now works from tclsh wrapped as a
bundled executable, and also unbundled if the above code is enabled.
In particular, this also allows the Tcl::Tk perl module to properly
load TkAqua:
http://search.cpan.org/~vkon/Tcl/
http://search.cpan.org/~vkon/Tcl-Tk/
get release 0.84 which has my changes to build the Tcl module against
Tcl.framework; and configure the Tcl module with
perl Makefile.PL --tclconfig
/Library/Frameworks/Tcl.framework/tclConfig.sh --usestubs
INSTALLSITEMAN3DIR=/usr/local/man/man3
and the Tcl::Tk module with
perl Makefile.PL INSTALLSITEMAN3DIR=/usr/local/man/man3
both modules should pass all their 'make test's...
Jim, could you review this for checkin?
Cheers,
Daniel
--
** Daniel A. Steffen ** "And now for something completely
** Dept. of Mathematics ** different" Monty Python
** Macquarie University **
** NSW 2109 Australia ** <http://www.maths.mq.edu.au/~steffen/>
|