|
From: Donald G P. <dg...@ni...> - 2005-01-24 18:07:58
|
> > if {![package vsatisfies [package provide Tcl] 8.5]} {return}
> > if {[catch {package present Tk 8.5}] != 0} {return}
> > if {[tk windowingsystem] ne "x11"} {return}
> > package ifneeded Tile 0.5 [list load [file join $dir libtile.so]]
>
> Is that going to address the issue - how to selectively load the shared
> library depending on the windowing system when Tk hasn't necessarily
> been "package required" when the Tile pkgIndex.tcl runs?
The index script above is for the Tile 0.5 shared library that is
configured to work with X11.
There could be another Tile 0.5 shared library configured to work
with Aqua. It would have its own index script, nearly the same
as above, but with "aqua" appearing where "x11" appears above.
This scheme allows either one or both variants of the package to
be installed independently. If both are installed, [tclPkgUnknown]
will run both index scripts and the proper [package ifneeded] command
will be evaluated.
If package Tk is not present at the time of [package require Tile 0.5],
then the Tile package will not be found. The index script(s) above
require the application to do:
package require Tk 8.5
package require Tile 0.5
in order. Since I cannot imagine any application that will use
Tile commands that would not also use Tk commands, I don't think
this limitation imposes any burden.
| Don Porter Mathematical and Computational Sciences Division |
| don...@ni... Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
|