Tk Source Code

View Ticket
Login
Ticket UUID: 222677
Title: toplevel with '-use 0x...' doesn't receive <Destroy> e
Type: Bug Version: obsolete: 8.5a3
Submitter: vincentdarley Created on: 2000-11-17 10:22:07
Subsystem: 69. Events Assigned To: chengyemao
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2004-12-19 03:42:55
Resolution: None Closed By: chengyemao
    Closed on: 2004-12-18 20:42:55
Description:
This is on Windows 2000 pro, service pack 1.

keywords: embedding, -use, -container.

Start up two copies of wish.  In the first, type:

% toplevel .t -container 1
.t
% winfo id .t
0x290526
% bind .t <Destroy> {puts "destroyed %W"}
% 

In the second, type:

% toplevel .s -use 0x290526
.s
% bind .s <Destroy> {puts "destroyed %W"}
% 

Now, '.s' is embedded inside '.t', which is great!  (very cool functionality!).  However, if I now destroy .t (by, say, clicking on the close-box), a message:

destroyed .t

appears in the console of the first wish, but no corresponding 'destroyed .s' message every appears (and in fact '.s' still exists, but is just not shown anywhere):

% winfo children .
.s
% wm geometry .s
200x200+0+0
% winfo ismapped .s
1
% .s cget -use
0x290526
% wm state .s
withdrawn
% wm deiconify .s
can't deiconify .s: it is an embedded window

Is this the desired behaviour?  Whether it is or not, does anyone know of any workarounds?  How can the interpreter that owns '.s' find out that .s has ceased to be a useful window...?

cheers,

Vince.
User Comments: chengyemao added on 2004-12-19 03:42:55:
Logged In: YES 
user_id=191079

The bug has been fixed.

chengyemao added on 2004-12-19 00:36:57:
Logged In: YES 
user_id=191079

It should not be a desired behavor for Wish since Wish is 
unable to reuse an embedded when it becomes orphaned.  
However, wish should notify the embedded window for 
destroying its container.  

I will consider this behavior as a bug. 

The latest change to Tk 8.5 do not fix this bug.  I will take a 
look at this case to see what I can do.

vincentdarley added on 2004-12-17 22:23:08:
Logged In: YES 
user_id=32170

Does your latest change to tk 8.5a3 fix this problem?