For Programmers: Free Programming Magazines  


Home > Archive > Tcl > March 2006 > tkdnd installation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author tkdnd installation
Hans Herrmann

2006-03-24, 10:01 pm

Hi,
please help with the tkdnd installation under Windows xp.
After extraction I got libtkdnd10.dll. I copied it in diverse directories ...
package require tkdnd doesn't work.
Thanks
Hans
Michael Schlenker

2006-03-24, 10:01 pm

Hans Herrmann schrieb:
> Hi,
> please help with the tkdnd installation under Windows xp.
> After extraction I got libtkdnd10.dll. I copied it in diverse
> directories ... package require tkdnd doesn't work.
> Thanks
> Hans

Is there a pkgIndex.tcl file that can load tkdnd?

If not, try the 'load' command instead, with the full path to the dll.

Michael
Georgios Petasis

2006-03-24, 10:01 pm

"Michael Schlenker" <schlenk@uni-oldenburg.de> wrote in message
news:48isflFkc44iU1@news.dfncis.de...
> Hans Herrmann schrieb:
> Is there a pkgIndex.tcl file that can load tkdnd?
>
> If not, try the 'load' command instead, with the full path to the dll.
>
> Michael


Does the pkgIndex.tcl conatins the following?

namespace eval ::dnd {
##
## This function will allow the loading the shared library, found in the
## following places:
## 1) The first location searched is a directory derived from the
platform
## we are running. For example under windows an attempt will be made to
## load the library from the "Windows" subdirectory, or from "Linux", if
## we are running under Linux. This allows us to ship tkdnd with support
## for multiple operating systems simultaneously.
##
## 2) If the above fails, we revert to the original behaviour of "load".
proc _load {dir} {
set version 1.0
switch $::tcl_platform(platform) {
windows {
if {[catch {load [file join $dir libtkdnd[string map {. {}} \
$version][info sharedlibextension]] tkdnd} error]} {
## The library was not found. Perhaps under a directory with
the
## OS name?
if {[catch {load [file join $dir Windows \
libtkdnd[string map {. {}} $version][info \
sharedlibext]] tkdnd} error2]} {
return -code error "$error\n$error2"
}
}
}
default {
if {[catch {load [file join $dir \
libtkdnd$version[info sharedlibextension]] tkdnd} error]} {
## The library was not found. Perhaps under a directory with
the
## OS name?
if {[catch {load [file join $dir $::tcl_platform(os) \
libtkdnd$version[info sharedlibextension]]
tkdnd}]} {
return -code error $error
}
}
}
}
source [file join $dir tkdnd.tcl]
package provide tkdnd $version
}
}

package ifneeded tkdnd 1.0 [list ::dnd::_load $dir]


Hans Herrmann

2006-03-25, 7:03 pm


"Georgios Petasis" <petasis@iit.demokritos.gr> schrieb im Newsbeitrag news:e01okn$1ma2$1@ulysses.noc.ntua.gr...
> "Michael Schlenker" <schlenk@uni-oldenburg.de> wrote in message
> news:48isflFkc44iU1@news.dfncis.de...
>
> Does the pkgIndex.tcl conatins the following?
>
> namespace eval ::dnd {
> ##
> ## This function will allow the loading the shared library, found in the
> ## following places:
> ## 1) The first location searched is a directory derived from the
> platform
> ## we are running. For example under windows an attempt will be made to
> ## load the library from the "Windows" subdirectory, or from "Linux", if
> ## we are running under Linux. This allows us to ship tkdnd with support
> ## for multiple operating systems simultaneously.
> ##
> ## 2) If the above fails, we revert to the original behaviour of "load".
> proc _load {dir} {
> set version 1.0
> switch $::tcl_platform(platform) {
> windows {
> if {[catch {load [file join $dir libtkdnd[string map {. {}} \
> $version][info sharedlibextension]] tkdnd} error]} {
> ## The library was not found. Perhaps under a directory with
> the
> ## OS name?
> if {[catch {load [file join $dir Windows \
> libtkdnd[string map {. {}} $version][info \
> sharedlibext]] tkdnd} error2]} {
> return -code error "$error\n$error2"
> }
> }
> }
> default {
> if {[catch {load [file join $dir \
> libtkdnd$version[info sharedlibextension]] tkdnd} error]} {
> ## The library was not found. Perhaps under a directory with
> the
> ## OS name?
> if {[catch {load [file join $dir $::tcl_platform(os) \
> libtkdnd$version[info sharedlibextension]]
> tkdnd}]} {
> return -code error $error
> }
> }
> }
> }
> source [file join $dir tkdnd.tcl]
> package provide tkdnd $version
> }
> }
>
> package ifneeded tkdnd 1.0 [list ::dnd::_load $dir]
>
>


Hi Georgios,

thanks for your answer!
After creating a pkgIndex.tcl and copying your script in it, "package require tkdnd 1.0" works.

Another question:

Can I use your plugin to drag 'n drop a (source)file in multiple directories simultaneously?

Thanks for a simple example?!

Hans
Hans Herrmann

2006-03-25, 7:03 pm


"Michael Schlenker" <schlenk@uni-oldenburg.de> schrieb im Newsbeitrag news:48isflFkc44iU1@news.dfncis.de...
> Hans Herrmann schrieb:
> Is there a pkgIndex.tcl file that can load tkdnd?
>
> If not, try the 'load' command instead, with the full path to the dll.
>
> Michael


Hi Michael,

thanks for your answer, it works!

Hans
Hans Herrmann

2006-03-25, 7:03 pm


"Georgios Petasis" <petasis@iit.demokritos.gr> schrieb im Newsbeitrag news:e01okn$1ma2$1@ulysses.noc.ntua.gr...
> "Michael Schlenker" <schlenk@uni-oldenburg.de> wrote in message
> news:48isflFkc44iU1@news.dfncis.de...
>
> Does the pkgIndex.tcl conatins the following?
>
> namespace eval ::dnd {
> ##
> ## This function will allow the loading the shared library, found in the
> ## following places:
> ## 1) The first location searched is a directory derived from the
> platform
> ## we are running. For example under windows an attempt will be made to
> ## load the library from the "Windows" subdirectory, or from "Linux", if
> ## we are running under Linux. This allows us to ship tkdnd with support
> ## for multiple operating systems simultaneously.
> ##
> ## 2) If the above fails, we revert to the original behaviour of "load".
> proc _load {dir} {
> set version 1.0
> switch $::tcl_platform(platform) {
> windows {
> if {[catch {load [file join $dir libtkdnd[string map {. {}} \
> $version][info sharedlibextension]] tkdnd} error]} {
> ## The library was not found. Perhaps under a directory with
> the
> ## OS name?
> if {[catch {load [file join $dir Windows \
> libtkdnd[string map {. {}} $version][info \
> sharedlibext]] tkdnd} error2]} {
> return -code error "$error\n$error2"
> }
> }
> }
> default {
> if {[catch {load [file join $dir \
> libtkdnd$version[info sharedlibextension]] tkdnd} error]} {
> ## The library was not found. Perhaps under a directory with
> the
> ## OS name?
> if {[catch {load [file join $dir $::tcl_platform(os) \
> libtkdnd$version[info sharedlibextension]]
> tkdnd}]} {
> return -code error $error
> }
> }
> }
> }
> source [file join $dir tkdnd.tcl]
> package provide tkdnd $version
> }
> }
>
> package ifneeded tkdnd 1.0 [list ::dnd::_load $dir]
>
>

Hi Georgios,

something I do wrong:

after first "package require tkdnd" it fails with the message:

couldn't read file "C:/Programme/Tcl/lib/tkdnd/tkdnd.tcl": no such file or directory

After second "package require tkdnd" it works with:

1.0

What's wrong?

Hans
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com