Tk Source Code

View Ticket
Login
Ticket UUID: 899246
Title: Really bizarre [grid] behaviour
Type: Bug Version: obsolete: 8.5a0
Submitter: dkf Created on: 2004-02-18 01:06:19
Subsystem: 49. [grid] Assigned To: pspjuth
Priority: 7 High Severity:
Status: Closed Last Modified: 2004-02-19 04:47:15
Resolution: Fixed Closed By: pspjuth
    Closed on: 2004-02-18 21:47:15
Description:
Run the following short script and then resize the
window vertically until there is not quite enough space
to hold buttons b3 and b4.  At that point, b3 suddenly
becomes much larger; click it to find out what size it
is requesting at that point.  Isn't this wrong?!

Problem occurs in 8.4.4 (on Win98) for sure, and is
reported in both 8.4.5 and 8.5a0 by other people.

button .b1 -text b1
text .t2 -height 5
button .b3 -text b3 -bg red -command {
   puts b3=([winfo reqw .b3]x[winfo reqh .b3])
}
button .b4 -text b4
grid configure .b1 -row 0 -column 0 -sticky newsgrid
configure .t2 -row 1 -column 0 -sticky news
grid configure .b3 -row 2 -column 0 -sticky news
grid configure .b4 -row 3 -column 0 -sticky news
grid columnconfigure . 0 -weight 1
grid rowconfigure . 0 -weight 1
grid rowconfigure . 1 -weight 10000
I'm not sure what's supposed to happen exactly in this
case, but not what is happening for sure!
User Comments: pspjuth added on 2004-02-19 04:47:15:
Logged In: YES 
user_id=98900

Fixed in 8.5a1 and 8.4.6.

pspjuth added on 2004-02-19 03:24:26:
Logged In: YES 
user_id=98900

Fixed in the 8.4 branch.


Leaving it open for 8.5.

pspjuth added on 2004-02-18 16:57:56:
Logged In: YES 
user_id=98900

First, the high -weight has nothing to do with this, the
same thing happens with a low one.
The calculations goes wrong when there is not enough room.
The first window with weight=0 gets the size of all requested 
sizes from the first row up to and including that window's row.
I can fix this tonight, but if that is too late for 8.4.6 and
someone else wants to try:
The error is in AdjustOffsets, the loop after the line
    if (size <= minSize) {
where the offsets are used and updated in the same loop.