Tk Source Code

View Ticket
Login
Ticket UUID: 220401
Title: Bug in "wm maxsize" on Win 95 and NT (8.0.3)
Type: Bug Version: obsolete: 8.2
Submitter: welch Created on: 2000-10-31 23:16:34
Subsystem: 68. Win Window Operations Assigned To: nobody
Priority: 2 Severity:
Status: Closed Last Modified: 2001-03-23 02:22:00
Resolution: Fixed Closed By: dgp
    Closed on: 2001-03-22 19:22:00
Description:
OriginalBugID: 878 Bug
Version: 8.0.3
SubmitDate: '1998-11-25'
LastModified: '2000-04-03'
Severity: MED
Status: Released
Submitter: pat
ChangedBy: hobbs
OS: All Windows
FixedDate: '2000-04-03'
FixedInVersion: 8.3


From: Jeff David <[email protected]>

Try this simple chunk of code in 8.0.3:

    set win .w
    set x [expr int(.3 * [winfo screenwidth .])]
    toplevel $win

    text $win.txt -wrap word -yscrollcommand "$win.sb set"
    scrollbar $win.sb -orient vert -command "$win.txt yview"
    pack $win.txt -side left -fill both -expand true
    pack $win.sb -side right -fill y
    $win.txt insert 0.0 "This is a test"

#    set x [expr int(.3 * [winfo screenwidth .])]
    update idle
    set x [winfo reqwidth $win]
   wm maxsize $win $x [winfo screenheight .]
    wm geometry $win "-0+0"
    update idletasks

It works as expected.  It places a text widget and scrollbar
widget in $win and places it in the upper right corner of the
screen.

Now, uncomment the "wm maxsize..." line.  Not only is the window
no longer positioned in the upper right corner of the screen, but
the scrollbar disappears!

I've tested this on both Windows 95 and Win NT 4.0.  Same thing.
"wm minsize" seems to work fine.  Any known fixes/workarounds?

The geometry management bug was fixed in 8.3, and the reason
that the scrollbar disappears is because we've asked for a
space in the 'pack'ed window that only fits the text widget.
The user should use grid geometry management, or make a smaller
default text box.  Really, the user probably wants:
   update idle ; set x [winfo reqwidth $win]
 
-- 04/03/2000 hobbs