diff options
author | petasis <petasis@f3661a36-4baa-549a-d6c7-40e0ffef350e> | 2010-04-06 12:25:12 (GMT) |
---|---|---|
committer | petasis <petasis@f3661a36-4baa-549a-d6c7-40e0ffef350e> | 2010-04-06 12:25:12 (GMT) |
commit | 1c1422c384206a342475c9e9afb08ab1b05115a7 (patch) | |
tree | 98d26362f379a6d5624145d2ab2055c2f01f31ce /library/tkdnd.tcl | |
parent | af403971e099fad367b7b8c932bb85223b644214 (diff) | |
download | tkdnd-1c1422c384206a342475c9e9afb08ab1b05115a7.zip tkdnd-1c1422c384206a342475c9e9afb08ab1b05115a7.tar.gz tkdnd-1c1422c384206a342475c9e9afb08ab1b05115a7.tar.bz2 |
OS X Drag attempts
Diffstat (limited to 'library/tkdnd.tcl')
-rw-r--r-- | library/tkdnd.tcl | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/library/tkdnd.tcl b/library/tkdnd.tcl index 8faf2cf..61f10e6 100644 --- a/library/tkdnd.tcl +++ b/library/tkdnd.tcl @@ -286,9 +286,27 @@ proc tkdnd::_init_drag { source state rootX rootY } { %t [bind $source <<DragSourceTypes>>]] $cmd] set info [uplevel \#0 $cmd] if { $info != "" } { + variable _windowingsystem foreach { actions types data } $info { break } set types [platform_specific_types $types] - set action [_DoDragDrop $source $actions $types $data] + set action refuse_drop + switch $_windowingsystem { + x11 { + error "dragging from Tk widgets not yet supported" + } + win32 - + windows { + set action [_DoDragDrop $source $actions $types $data] + } + aqua { + set action [macdnd::dodragdrop $source $actions $types $data] + } + default { + error "unknown Tk windowing system" + } + } + ## Call _end_drag to notify the widget of the result of the drag + ## operation... _end_drag $source {} $action {} $data {} $state $rootX $rootY } } @@ -307,11 +325,28 @@ proc tkdnd::_end_drag { source target action type data result set cmd [string map [list %W $source %X $rootX %Y $rootY \ %S $state %e <<DragEndCmd>> %A \{$action\}] $cmd] set info [uplevel \#0 $cmd] - if {$info != ""} { + if { $info != "" } { + variable _windowingsystem foreach { actions types data } $info { break } set types [platform_specific_types $types] - set action [_DoDragDrop $source $actions $types $data] - _end_drag $source {} $action {} $data {} + switch $_windowingsystem { + x11 { + error "dragging from Tk widgets not yet supported" + } + win32 - + windows { + set action [_DoDragDrop $source $actions $types $data] + } + aqua { + macdnd::dodragdrop $source $actions $types $data + } + default { + error "unknown Tk windowing system" + } + } + ## Call _end_drag to notify the widget of the result of the drag + ## operation... + _end_drag $source {} $action {} $data {} $state $rootX $rootY } } };# tkdnd::_end_drag |