From: Csaba Nemethi on
Consider the following simple script:

text .t
pack .t -expand yes -fill both
..t insert end "abcd\n\n"

message .t.m -text "Text consisting of several words"
..t window create 1.2 -window .t.m

set count 0
bind .t <Configure> {
incr count
.t insert end "<Configure> #$count width = [winfo width .t]\n"
if {$count == 9} {
.t delete 1.2
.t insert end "\nDestroyed message widget\n"
}
}

By *slowly* resizing the window, you can see the lines written to the
text widget by the binding script associated with the <Configure> event.
After 9 such events, the script (implicitly) deletes the embedded
message window. Strangely enough, *on Windows* this causes the text
widget to get resized to its original width and height, which in turn
generates a new <Configure> event and cancels the interactive resizing.

It is not relevant that the embedded window is a message widget. Also,
prepending "after 1000" to the ".t delete 1.2" invocation doesn't solve
the problem either.

Another unsuccessful attempt to eliminate the problem was to remove the
association between the embedded window and the text widget before
destroying the former:

.t window configure 1.2 -window ""
.t delete 1.2
destroy .t.m

Although the window is no longer embedded into the text widget,
destroying it triggers the unexpected change in the widget's size!

I have tested the script with ActiveTcl 8.4, 8.5, and 8.6. On Linux and
Mac OS X it works fine, but on Windows (XP) it exposes the strange
behavior described above.

Any ideas?

--
Csaba Nemethi http://www.nemethi.de mailto:csaba.nemethi(a)t-online.de

From: Georgios Petasis on
στις 20/6/2010 17:40, O/H Csaba Nemethi έγραψε:
> Consider the following simple script:
>
> text .t
> pack .t -expand yes -fill both
> .t insert end "abcd\n\n"
>
> message .t.m -text "Text consisting of several words"
> .t window create 1.2 -window .t.m
>
> set count 0
> bind .t<Configure> {
> incr count
> .t insert end "<Configure> #$count width = [winfo width .t]\n"
> if {$count == 9} {
> .t delete 1.2
> .t insert end "\nDestroyed message widget\n"
> }
> }
>
> By *slowly* resizing the window, you can see the lines written to the
> text widget by the binding script associated with the<Configure> event.
> After 9 such events, the script (implicitly) deletes the embedded
> message window. Strangely enough, *on Windows* this causes the text
> widget to get resized to its original width and height, which in turn
> generates a new<Configure> event and cancels the interactive resizing.
>
> It is not relevant that the embedded window is a message widget. Also,
> prepending "after 1000" to the ".t delete 1.2" invocation doesn't solve
> the problem either.
>
> Another unsuccessful attempt to eliminate the problem was to remove the
> association between the embedded window and the text widget before
> destroying the former:
>
> .t window configure 1.2 -window ""
> .t delete 1.2
> destroy .t.m
>
> Although the window is no longer embedded into the text widget,
> destroying it triggers the unexpected change in the widget's size!
>
> I have tested the script with ActiveTcl 8.4, 8.5, and 8.6. On Linux and
> Mac OS X it works fine, but on Windows (XP) it exposes the strange
> behavior described above.
>
> Any ideas?
>

I can reproduce it also under windows 7, with the latest ActiveTcl 8.6 beta.

It looks like a bug.

George