summaryrefslogtreecommitdiffstats
path: root/demos/dndSpy.tcl
diff options
context:
space:
mode:
authorpetasis <petasis@f3661a36-4baa-549a-d6c7-40e0ffef350e>2012-06-02 20:59:00 (GMT)
committerpetasis <petasis@f3661a36-4baa-549a-d6c7-40e0ffef350e>2012-06-02 20:59:00 (GMT)
commitdffa1a3e62e8a1fc88866073d9b556ef9f5b6be9 (patch)
tree92ed75b6edfc4ddf2ade88d05c3d31c826e38e60 /demos/dndSpy.tcl
parent0e2f667eee2a8402a0a4ea11c6820dab232ab4a3 (diff)
downloadtkdnd-dffa1a3e62e8a1fc88866073d9b556ef9f5b6be9.zip
tkdnd-dffa1a3e62e8a1fc88866073d9b556ef9f5b6be9.tar.gz
tkdnd-dffa1a3e62e8a1fc88866073d9b556ef9f5b6be9.tar.bz2
Linux Qt fixes
Diffstat (limited to 'demos/dndSpy.tcl')
-rw-r--r--demos/dndSpy.tcl16
1 files changed, 15 insertions, 1 deletions
diff --git a/demos/dndSpy.tcl b/demos/dndSpy.tcl
index 6d1142a..be0c9e2 100644
--- a/demos/dndSpy.tcl
+++ b/demos/dndSpy.tcl
@@ -16,12 +16,18 @@ if {$::tcl_version == "8.3" && ![package vsatisfies $::tcl_patchLevel 8.3.3]} {
## Make sure that we can find the tkdnd package even if the user has not yet
## installed the package.
-if {[catch {package require tkdnd}]} {
+if {[catch {package require tkdnd} version]} {
set DIR [file dirname [file dirname [file normalize [info script]]]]
source $DIR/library/tkdnd.tcl
foreach dll [glob -type f $DIR/*tkdnd*[info sharedlibextension]] {
tkdnd::initialise $DIR/library ../[file tail $dll] tkdnd
}
+ set package_info "Found tkdnd package version (unknown)\n\
+ \nPackage loading info:\n\n$dll"
+} else {
+ set package_info "Found tkdnd package version $version\n\
+ \nPackage loading info:\n\n[package ifneeded tkdnd $version]"
+
}
## Place a listbox. This will be our drop target, which will also display the
@@ -31,6 +37,7 @@ pack [listbox .typeList -height 25 -width 50] -side left -padx 2 -pady 2 \
## A text widget to display the dropped data...
pack [text .data -height 25 -width 80] -side left -padx 2 -pady 2 -fill both \
-expand 1
+.data insert end $package_info
pack [button .exit -text { Exit } -command exit] -side bottom -pady 5 -padx 5
proc FillTypeListbox {listbox types type codes code actions action mods} {
@@ -103,3 +110,10 @@ dnd bindtarget .typeList $type <Drop> \
dnd bindtarget .typeList $type <DragLeave> \
".typeList configure -bg $bg"
raise .
+
+proc show_widget_under_cursor {} {
+ puts "Mouse coordinates: [winfo pointerxy .]"
+ puts "Widget under cursor: [winfo containing 200 200]"
+ after 200 show_widget_under_cursor
+};# show_widget_under_cursor
+#show_widget_under_cursor