[Pythonmac-SIG] TCL is going to have loadable TK...
Jerry LeVan
jerry.levan at eku.edu
Sat Oct 2 21:06:56 CEST 2004
This recently appeared on the Mac-TCL list....
so maybe python could do something similar...
Jerry
> 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
More information about the Pythonmac-SIG
mailing list