diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | library/clrpick.tcl | 14 | ||||
-rw-r--r-- | library/msgbox.tcl | 14 |
3 files changed, 17 insertions, 16 deletions
@@ -1,5 +1,10 @@ 2003-02-21 Donal K. Fellows <fellowsd@cs.man.ac.uk> + * library/clrpick.tcl (color::BuildDialog): + * library/msgbox.tcl (MessageBox): Yet more places that did + complex and fragile width calculations instead of using grid, + though with these it is the -uniform option that saves the day. + * library/tkfbox.tcl (file::Create): This procedure was really very crufty in how it went about creating the GUI. It is far easier and more robust to use the grid geometry manager than it is diff --git a/library/clrpick.tcl b/library/clrpick.tcl index db5cc09..8f1acbb 100644 --- a/library/clrpick.tcl +++ b/library/clrpick.tcl @@ -3,7 +3,7 @@ # Color selection dialog for platforms that do not support a # standard color selection dialog. # -# RCS: @(#) $Id: clrpick.tcl,v 1.19 2002/07/22 21:25:39 mdejong Exp $ +# RCS: @(#) $Id: clrpick.tcl,v 1.20 2003/02/21 14:40:26 dkf Exp $ # # Copyright (c) 1996 Sun Microsystems, Inc. # @@ -296,20 +296,20 @@ proc ::tk::dialog::color::BuildDialog {w} { # the botFrame frame contains the buttons # set botFrame [frame $w.bot -relief raised -bd 1] - set maxWidth [::tk::mcmaxamp &OK &Cancel] - set maxWidth [expr {$maxWidth<8?8:$maxWidth}] + ::tk::AmpWidget button $botFrame.ok -text [mc "&OK"] \ - -width $maxWidth \ -command [list tk::dialog::color::OkCmd $w] ::tk::AmpWidget button $botFrame.cancel -text [mc "&Cancel"] \ - -width $maxWidth \ -command [list tk::dialog::color::CancelCmd $w] set data(okBtn) $botFrame.ok set data(cancelBtn) $botFrame.cancel - pack $botFrame.ok $botFrame.cancel \ - -padx 10 -pady 10 -expand yes -side left + grid x $botFrame.ok x $botFrame.cancel x -sticky ew + grid configure $botFrame.ok $botFrame.cancel -padx 10 -pady 10 + grid columnconfigure $botFrame {0 4} -weight 1 -uniform space + grid columnconfigure $botFrame {1 3} -weight 1 -uniform button + grid columnconfigure $botFrame 2 -weight 2 -uniform space pack $botFrame -side bottom -fill x diff --git a/library/msgbox.tcl b/library/msgbox.tcl index a694bb3..b943fb4 100644 --- a/library/msgbox.tcl +++ b/library/msgbox.tcl @@ -3,7 +3,7 @@ # Implements messageboxes for platforms that do not have native # messagebox support. # -# RCS: @(#) $Id: msgbox.tcl,v 1.23 2002/08/31 06:12:28 das Exp $ +# RCS: @(#) $Id: msgbox.tcl,v 1.24 2003/02/21 14:40:26 dkf Exp $ # # Copyright (c) 1994-1997 Sun Microsystems, Inc. # @@ -201,15 +201,10 @@ proc ::tk::MessageBox {args} { yesno, or yesnocancel" } } - - set maxWidth [eval mcmaxamp $labels] - if {$maxWidth <6} { - set maxWidth 6 - } set buttons {} foreach name $names lab $labels { - lappend buttons [list $name -width $maxWidth -text [mc $lab]] + lappend buttons [list $name -text [mc $lab]] } # If no default button was specified, the default default is the @@ -355,7 +350,9 @@ proc ::tk::MessageBox {args} { } else { $w.$name configure -default normal } - pack $w.$name -in $w.bot -side left -expand 1 -padx 3m -pady 2m + grid $w.$name -in $w.bot -row 0 -column $i -padx 3m -pady 2m -sticky ew + grid columnconfigure $w.bot $i -weight 1 -uniform buttons + incr i # create the binding for the key accelerator, based on the underline # @@ -365,7 +362,6 @@ proc ::tk::MessageBox {args} { # bind $w <Alt-[string tolower $key]> [list $w.$name invoke] # bind $w <Alt-[string toupper $key]> [list $w.$name invoke] # } - # incr i } bind $w <Alt-Key> [list ::tk::AltKeyInDialog $w %A] |