Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Marriage is the only adventure open to the cowardly. -- Voltaire


devel / comp.lang.tcl / tkdnd (drag and drop) not working as expected

SubjectAuthor
* tkdnd (drag and drop) not working as expectedLuc
`- Re: tkdnd (drag and drop) not working as expectedLuc

1
tkdnd (drag and drop) not working as expected

<20230525223918.7e469e71@lud1.home>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22132&group=comp.lang.tcl#22132

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: tkdnd (drag and drop) not working as expected
Date: Thu, 25 May 2023 22:39:18 -0300
Organization: A noiseless patient Spider
Lines: 91
Message-ID: <20230525223918.7e469e71@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="521d10c3701a7d6bf74ec43a33239e56";
logging-data="3926975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX185APIyua8X8xtUn8KUt25yC7Q4uHr8b78="
Cancel-Lock: sha1:fjFSmTKP0qLVef+9JzxcTiFhIWY=
 by: Luc - Fri, 26 May 2023 01:39 UTC

This code works:

------------------------
package require Tk
package require tkdnd

proc p.playwav {argWavFile} {
package require sound
snack::sound s -file $argWavFile; s play -block 1
}

pack [ttk::button .drop_target -text " Drop Target (I can accept anything!) "] -fill x -padx 20 -pady 20
tkdnd::drop_target register .drop_target *
bind .drop_target <<Drop>> {puts %D; return %A}
------------------------

This code also works:

------------------------
package require Tk
package require tkdnd
package require tile
wm withdraw .
set ::w [toplevel .dnd -background #c0c0c0]
wm resizable $::w 1 1

set ::outerframe $::w.outerframe
set ::dropbutton $::w.dropbutton

frame $::outerframe
$::outerframe configure -background #ADD8E6
pack $::outerframe -fill both -expand 1

button $::dropbutton
$::dropbutton configure -background #d9d9d9 -foreground #000000
$::dropbutton configure -font "Freesans 12" -text "DROP"
$::dropbutton configure -borderwidth 1 -relief raised -overrelief ridge
pack $::dropbutton -side right

tkdnd::drop_target register $::dropbutton *
bind .drop_target <<Drop>> {puts %D; return %A}
------------------------

But this code doesn't work:

------------------------
package require Tk
package require tkdnd
package require tile
wm withdraw .
set ::w [toplevel .dnd -background #c0c0c0]
wm resizable $::w 1 1

proc p.playwav {argWavFile} {
package require sound
snack::sound s -file $argWavFile; s play -block 1
}

set ::outerframe $::w.outerframe
set ::dropbutton $::outerframe.dropbutton

frame $::outerframe
$::outerframe configure -background #ADD8E6
pack $::outerframe -fill both -expand 1

button $::dropbutton
$::dropbutton configure -background #d9d9d9 -foreground #000000
$::dropbutton configure -font "Freesans 12" -text "DROP"
$::dropbutton configure -borderwidth 1 -relief raised -overrelief ridge
pack $::dropbutton -side right

tkdnd::drop_target register $::dropbutton *
bind .drop_target <<Drop>> {puts %D; return %A}
------------------------

In other words, the "drop target" only works if it's not inside a frame?
[shrug]

Looks like a bug to me. Can someone please have a look to make sure
I am not doing something wrong before I attempt to file a bug report
or something?

--
Luc
>>

Re: tkdnd (drag and drop) not working as expected

<20230525224212.74e9b7bb@lud1.home>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22133&group=comp.lang.tcl#22133

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: tkdnd (drag and drop) not working as expected
Date: Thu, 25 May 2023 22:42:12 -0300
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <20230525224212.74e9b7bb@lud1.home>
References: <20230525223918.7e469e71@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="521d10c3701a7d6bf74ec43a33239e56";
logging-data="3926975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/yYO7h1CLWNhOCpVgl5hNv5MR5dbOq6oE="
Cancel-Lock: sha1:zLIcTHXlaoS46FDp8t+JO9pnJjs=
 by: Luc - Fri, 26 May 2023 01:42 UTC

Note:

The p.playwav proc should not have been included in my previous code.
I use sounds for testing the drag and drop action, but the code also
provides for puts statements. Please disregard the additional proc.

--
Luc
>>


devel / comp.lang.tcl / tkdnd (drag and drop) not working as expected

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor