Tk Library Source Code

Artifact [dd959f11f0]
Login

Artifact dd959f11f07ebc4a58226911edb49c4c647bf847:

Attachment "buttonbox-patch" to ticket [1362899fff] added by dev_null42a 2005-11-21 23:26:11.
--- buttonbox.tcl	2005-11-21 11:12:07.000000000 -0500
+++ buttonbox-new.tcl	2005-11-21 11:11:59.000000000 -0500
@@ -355,7 +355,7 @@ proc ButtonBox::_redraw { path } {
                     grid columnconfigure $path [expr {2*$i}] -minsize $req
                     set data(max) $req
                 }
-                grid columnconfigure $path $idx -minsize $data(max) -weight 1
+                grid columnconfigure $path $idx -weight 1
             } else {
                 grid columnconfigure $path $idx -weight 0
             }
@@ -379,6 +379,16 @@ proc ButtonBox::_redraw { path } {
         }
         incr idx 2
     }
+
+    # Now that the maximum size has been calculated, go back through
+    # and correctly set the size for homogeneous buttons.
+    if { [string equal [Widget::getoption $path -orient] "horizontal"] && [Widget::getoption $path -homogeneous] } {
+        set idx 0
+        foreach i $data(buttons) {
+            grid columnconfigure $path $idx -minsize $data(max)
+            incr idx 2
+        }
+    }
 }