Tk Library Source Code

View Ticket
Login
Ticket UUID: 1362899
Title: ButtonBox does calculate homogenous sizes correctly
Type: Bug Version: None
Submitter: dev_null42a Created on: 2005-11-21 16:26:06
Subsystem: bwidget Assigned To: dev_null42a
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2006-01-31 22:13:35
Resolution: Fixed Closed By: dev_null42a
    Closed on: 2006-01-31 15:13:35
Description:
Given a ButtonBox with -homogeneous 1 and -orient
horizontal, it is possible for buttons to be
incorrectly sized.  The [_redraw] procedure attempts to
determine the maximum button width and then sets the
columns' minsize.  However, it has not scanned /all/ of
the buttons and thus only knows the maximum size up to
that point; there could be an even larger button later
in the list.

The following code was tested under Linux/x86, Tk 8.4,
and BWidgets 1.7:

% package require BWidget
1.7
% Dialog .test -homogeneous 1
.test
% .test add -text "ok" ; .test add -text "really long
cancel button"
.test.bbox.b1
% puts [grid columnconfigure .test.bbox 0 -minsize];
puts [grid columnconfigure .test.bbox 2 -minsize]
44
169
% .test draw

Attached to this bug report is a patch that correctly
calculates button widths.  It should work for all cases.
User Comments: dev_null42a added on 2005-11-21 23:26:12:

File Added - 157080: buttonbox-patch

Attachments: