| Ticket UUID: | 3466588 | |||
| Title: | panedwindow resize problem with text -setgrid 1 | |||
| Type: | Bug | Version: | obsolete: 8.5.10 | |
| Submitter: | jwoelk2010 | Created on: | 2011-12-28 22:41:53 | |
| Subsystem: | 48. Geometry Management | Assigned To: | nobody | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Open | Last Modified: | 2025-03-19 22:05:06 | |
| Resolution: | None | Closed By: | nobody | |
| Closed on: | ||||
| Description: |
A panedwindow contains two frames, of which one is a text widget created with "-setgrid 1". When the top-level window is resized by more than about 20 pixel at a time, dragging the sash of the panedwindow also resizes the top-level window. Seen on Windows XP SP3 with Tcl/Tk 8.5.9 and 8.5.11. Omit the option "-setgrid 1" from the text widget command, and the problem is gone. That's ok for me. But I would like to have the problem documented, at least. The problem seems related to ID 1161543, where listboxes were used instead of a text. | |||
| User Comments: |
fvogel added on 2025-03-19 22:05:06:
See also [7c51624a96]. fvogel added on 2015-07-12 13:15:42: Maybe linked to http://core.tcl.tk/tk/tktview?name=917631ffff fvogel added on 2015-07-12 12:46:45: Test script showing the issue with no mouse movement needed:
package require Tk
catch {destroy .p .p.e1 .p.e2}
panedwindow .p -orient vertical
text .p.e1 -setgrid 1
frame .p.e2
.p add .p.e1
.p add .p.e2
pack .p -fill both -expand 1
update
wm geometry . 64x30+0+0
set y [lindex [.p sash coord 0] 1]
.p sash place 0 1 [expr $y+1] ; # execute this line separately
When running the last line, one can see the toplevel expand its vertical size. This happens for me on both Windows Vista and Win7.
I have analyzed this quite a bit in the Tk source code, and have made the following observations:
- I could not find a bug in Tk source code for panedwindow (so far).
- The above test script and the OP case work perfectly under Linux (Debian 6.0, Tcl/Tk 8.5.8 and 8.5.18): no dimension of the toplevel changes when placing the sash.
- On Linux, the wm correctly honors toplevel resizes with the mouse and correctly restricts allowed sizes to the grid. This is not the case under Windows (Vista and Win7 at least). Can't test on OSX.
Fundamentally, since it works on Linux and not on Windows, all code in the "generic" folder should be OK. This includes tkPanedWindow.c, tkGeometry.c, tkPack.c ...
This leaves two possibilities I think:
a. there is a bug somewhere in tkWinWm.c, i.e. in the Windows-specific implementation of the window manager interface
b. this is a window manager bug in Windows itself (at least Vista, Win7 and XP), rather than a Tk bug.
Regarding a., I could not find anything bizarre yet. OK, it doesn't mean it's fine there, but rather I would need help to debug (any taker?).
Regarding b., it is true that Windows just does not seem to honor -setgrid (or wm grid) settings. For instance, resizing a toplevel having a widget configured as -setgrid 1 does not restrict toplevel sizes to gridded sizes. Besides, I don't think that any test in wm.test checks that the window size really is restricted to gridded sizes.
Reassigning this ticket to section "48. Geometry Management".
fvogel added on 2015-06-01 06:30:46: Still happens with panedwindow Does not happen with ttk::panedwindow fvogelnew1 added on 2012-12-01 18:06:18: 1161543 is closed and appears to be fixed for me. However, replacing the text widget by a listbox in your example below triggers the buggy behavior that is reported by the OP. gaydov-victor added on 2012-12-01 03:33:22: -- Example -- panedwindow .p -orient vertical text .p.e1 -setgrid 1 frame .p.e2 .p add .p.e1 .p add .p.e2 pack .p -fill both -expand 1 gaydov-victor added on 2012-12-01 03:32:13: I can reproduce this bug on 8.5 and 8.6 (using Tk from debian). If window contains panewindow or tixPanedWindow and one pane is with "-setgrid 1", top-level window can't be resized completely. jwoelk2010 added on 2011-12-29 05:41:55: File Added - 431745: panedwindowbug.tcl | |||
Attachments:
- panedwindowbug.tcl [download] added by jwoelk2010 on 2011-12-29 05:41:54. [details]
