* Manfred Stelzhammer <manfred@antispam.at>
| % wm geometry . 400x400
| % . configure -background yellow
| % pack [frame .f1 -container 1] -fill both -expand yes
| % toplevel .top1 -use [winfo id .f1] -background red
| % bind .top1 <Destroy> "puts {DESTROY .top1}"
| % pack [frame .top1.f2 -container 1] -fill both -expand yes
| % toplevel .top2 -use [winfo id .top1.f2] -background green
| % bind .top2 <Destroy> "puts {DESTROY .top2}"
Make both bindings use %W to see which widget exactly gets the event:
bind .top1 <Destroy> "puts {DESTROY top1/%W}"
bind .top2 <Destroy> "puts {DESTROY top2/%W}"
=>
destroy .top2
DESTROY top2/.top2
DESTROY top1/.top1.f2
So, destroying .top2 alse destroys .top1.f2, but not .top1.
I have not checked the details of -container and -use, so I can't
comment on whether that is to be expected...
R'
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 297 |
Nodes: | 16 (2 / 14) |
Uptime: | 33:59:46 |
Calls: | 6,669 |
Calls today: | 1 |
Files: | 12,216 |
Messages: | 5,338,371 |