On 20/02/2010 9:48 AM, Laurence Anthony wrote:
I have taken your script and complied it into a standalone executable with
PerlApp. Everything worked here smoothly.
Getting PerlApp to see the tkdnd required the Tkx::lappend hack that you
discussed a while back. I'm sure there is a better way to do this.
If you have any suggestions, please let me know.
The lappend hack allows the Tkx tkkit to use whatever libraries are on
disk, but that is not necessarily what you want if you plan to wrap and
deploy using something like PerlApp.
You want the files to be placed into the tkkit itself. While it can be
done from Perl leveraging Tkx, it is easiest in Tcl since you have it
installed (you can't be using the tkkit when you want to modify it on
Windows).
Building on the my message at
http://www.nntp.perl.org/group/perl.tcltk/2008/11/msg190.html, here is
the basics to extend the tkkit. You'll have to flesh it out for where
your local tkdnd installed.
##################################
package require vfs
set tkkit "C:/Perl10/lib/auto/Tcl/tkkit.dll" ; # set to correct path
file attributes $tkkit -readonly 0 ; # needs to be writable
vfs::mk4::Mount $tkkit tkkit ; # mounts file as dir 'tkkit'
# where you installed Tcl and most lib files
set tcllib C:/Tcl/lib
# this is one of the built-in $::auto_path search areas
set tkkitlib tkkit/lib
# path to tkdnd lib files, complete with pkgIndex.tcl
set tkdnd $tcllib/tkdnd
file copy -force $tkdnd $tkkitlib
vfs::unmount tkkit
exit
###################################
Yeah, that could be shortened to a few lines, but the variables will
adapt it better for others to use for other libraries. With that, you
should have a tkkit with tkdnd now built-in. If you wrap, it will
deploy properly. Try this and remove your 'lappend' hacks.
The location of downloaded bits can get trickier in ActiveTcl if you are
grabbing them via teacup (equivalent to ppm), but where they go in the
tkkit remains the same.
Jeff