Tk Library Source Code

View Ticket
Login
Ticket UUID: 2807147
Title: buttonbox -homogeneous widths
Type: Patch Version: None
Submitter: danckaert Created on: 2009-06-16 12:47:58
Subsystem: bwidget Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2009-06-30 14:22:59
Resolution: Accepted Closed By: oehhar
    Closed on: 2009-06-24 12:09:28
Description:
In buttonbox.tcl, the code which is used to ensure homogeneous button widths is bad. It can't accomodate buttons of which the width changes after they are initially drawn. This can be solved by using grid's -uniform option instead of -minsize, as in the attached patch. The code is much cleaner too.
User Comments: oehhar added on 2009-06-30 14:22:59:
Correct->corrected.

danckaert added on 2009-06-25 21:53:26:
Ok, but you should have used a condition on 8.4 instead of 8.3.

oehhar added on 2009-06-24 19:09:28:
Hi Koen,
thank you for the patch and comments.

I included the patch into cvs with a condition on tcl 8.3.

I have posted a release strategy on "tcllib-dev" and nobody complained.
I want to stay backward compatible for the 1.9 release at the end of this month.

There is a 2.0 release planed end august to include additional ttk support.
Within this release, the code < tcl 8.3 might be removed and will effectively lead to much clearer code.

danckaert added on 2009-06-17 16:33:21:
Please don't consider Tcl/Tk 8.3 anymore! Including the patch conditionally will complicate the code instead of simplifying it. Note that 8.4 was released in 2002...
Maybe you should ask advice from a TCT member on this, but I think that those who really want to stick with Tcl/Tk 8.3 (or older), can also keep using BWidget 1.8 !
(In fact,  I even think this holds for Tcl/Tk 8.4, since also 8.5 is already almost 2 years old.)

danckaert added on 2009-06-17 16:22:22:
Here 's a test script. Note that -homogeneous only works for horizontal layout anyway.

pack [ButtonBox .bb -homogeneous 1]
.bb add -text A
.bb add -text B
.bb add -text C
.bb itemconfigure 1 -text BBBBBBBBBBBBBBBBBB

oehhar added on 2009-06-16 22:20:13:
Thank you for the patch.
The -uniform option was introduced in tcl/tk 8.4, so I would like to make it conditional to this release version.

I will look for it next week.

Could you please provide a test script to check the new functionality ?
(horizontal and vertical)

danckaert added on 2009-06-16 19:48:00:

File Added - 331181: buttonbox.patch

Attachments: