Tk Source Code

Artifact [b724e29b]
Login

Artifact b724e29b755e9252e0acb95425e466600a705302:

Attachment "panedwindowbug.tcl" to ticket [3466588f] added by jwoelk2010 2011-12-29 05:41:54.
#!/bin/sh
# the next line restarts using wish \
exec wish "$0" "$@"

wm title . "panedwindow resize problem with text -setgrid 1"

# A panedwindow:
panedwindow .p -orient vertical
pack .p -side top -fill both -expand yes

# A first frame in the upper part, containing a canvas:
frame .p.f -height 200 -width 600
set c .p.f.c
canvas $c -scrollregion "0 0 600 200" -height 200 -width 600
pack $c -side left -fill y -expand 1

# In the lower part of the panedwindow there is a frame with a text widget:
frame .p.textFrame
text .t -width 60 -height 12 -setgrid 1
pack .t -in .p.textFrame -expand yes -fill both -padx 1

.p add .p.f .p.textFrame

# Create the text for the text widget.
.t insert end "Demonstration of my panedwindow problem

Above this text, i.e. at the border between the grey and the white background, there is the sash of a panedwindow. You can drag the sash as expected.
But once you have resized the height of the top-level window (the application's window) by more than about 20 pixels (probably more than one text line's height) at a time, dragging the sash again will affect the height of the top-level window as well. At least under Windows XP SP3 with Tcl/Tk 8.5.7 and 8.5.11. If you omit option \"-setgrid 1\" from the text widget creation command, then the bug is gone. That's ok for me. But I would like to have the bug documented. The bug seems related to ID 1161543, where listboxes were used instead of a text.
"