From f6ba929ad9452334e5f333c21a081514ec88387c Mon Sep 17 00:00:00 2001 From: "patthoyts@users.sourceforge.net" Date: Fri, 17 Mar 2006 11:13:13 +0000 Subject: bug #1451587: avoid using abbreviated sub-commands in core scripts as this can cause problems with mega-widget libraries like snit. --- ChangeLog | 9 +++++++++ library/clrpick.tcl | 6 +++--- library/palette.tcl | 4 ++-- library/scale.tcl | 6 +++--- library/scrlbar.tcl | 6 +++--- library/tkfbox.tcl | 48 ++++++++++++++++++++++++------------------------ library/xmfbox.tcl | 14 +++++++------- 7 files changed, 51 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index a5ed2c6..d30a688 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-03-17 Pat Thoyts + + * library/clrpick.tcl: bug #1451587: avoid using abbreviated + * library/palette.tcl: sub-commands in core scripts as this + * library/scale.tcl: can cause problems with mega-widget + * library/scrlbar.tcl: libraries like snit. + * library/tkfbox.tcl: + * library/xmfbox.tcl: + 2006-03-16 Don Porter * generic/tkConsole.c: Substantial rewrite of [console] support. diff --git a/library/clrpick.tcl b/library/clrpick.tcl index ecc682c..216cdb8 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.21 2004/08/05 10:04:36 dkf Exp $ +# RCS: @(#) $Id: clrpick.tcl,v 1.22 2006/03/17 11:13:15 patthoyts Exp $ # # Copyright (c) 1996 Sun Microsystems, Inc. # @@ -666,7 +666,7 @@ proc ::tk::dialog::color::HandleRGBEntry {w} { proc ::tk::dialog::color::EnterColorBar {w color} { upvar ::tk::dialog::color::[winfo name $w] data - $data($color,sel) itemconfig $data($color,index) -fill red + $data($color,sel) itemconfigure $data($color,index) -fill red } # mouse leaves enters a color bar @@ -674,7 +674,7 @@ proc ::tk::dialog::color::EnterColorBar {w color} { proc ::tk::dialog::color::LeaveColorBar {w color} { upvar ::tk::dialog::color::[winfo name $w] data - $data($color,sel) itemconfig $data($color,index) -fill black + $data($color,sel) itemconfigure $data($color,index) -fill black } # user hits OK button diff --git a/library/palette.tcl b/library/palette.tcl index 6e380d8..323d372 100644 --- a/library/palette.tcl +++ b/library/palette.tcl @@ -3,7 +3,7 @@ # This file contains procedures that change the color palette used # by Tk. # -# RCS: @(#) $Id: palette.tcl,v 1.10 2006/01/25 18:22:04 dgp Exp $ +# RCS: @(#) $Id: palette.tcl,v 1.11 2006/03/17 11:13:15 patthoyts Exp $ # # Copyright (c) 1995-1997 Sun Microsystems, Inc. # @@ -171,7 +171,7 @@ proc ::tk::RecolorTree {w colors} { set option -[string tolower $dbOption] set class [string replace $dbOption 0 0 [string toupper \ [string index $dbOption 0]]] - if {![catch {$w config $option} value]} { + if {![catch {$w configure $option} value]} { # if the option database has a preference for this # dbOption, then use it, otherwise use the defaults # for the widget. diff --git a/library/scale.tcl b/library/scale.tcl index 01138d3..9f8f110 100644 --- a/library/scale.tcl +++ b/library/scale.tcl @@ -3,7 +3,7 @@ # This file defines the default bindings for Tk scale widgets and provides # procedures that help in implementing the bindings. # -# RCS: @(#) $Id: scale.tcl,v 1.13 2005/07/25 09:06:00 dkf Exp $ +# RCS: @(#) $Id: scale.tcl,v 1.14 2006/03/17 11:13:15 patthoyts Exp $ # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1995 Sun Microsystems, Inc. @@ -21,7 +21,7 @@ bind Scale { if {$tk_strictMotif} { set tk::Priv(activeBg) [%W cget -activebackground] - %W config -activebackground [%W cget -background] + %W configure -activebackground [%W cget -background] } tk::ScaleActivate %W %x %y } @@ -30,7 +30,7 @@ bind Scale { } bind Scale { if {$tk_strictMotif} { - %W config -activebackground $tk::Priv(activeBg) + %W configure -activebackground $tk::Priv(activeBg) } if {[%W cget -state] eq "active"} { %W configure -state normal diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index 57275f2..ec14473 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -3,7 +3,7 @@ # This file defines the default bindings for Tk scrollbar widgets. # It also provides procedures that help in implementing the bindings. # -# RCS: @(#) $Id: scrlbar.tcl,v 1.12 2005/09/10 14:53:20 das Exp $ +# RCS: @(#) $Id: scrlbar.tcl,v 1.13 2006/03/17 11:13:15 patthoyts Exp $ # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -22,7 +22,7 @@ if {[tk windowingsystem] eq "x11"} { bind Scrollbar { if {$tk_strictMotif} { set tk::Priv(activeBg) [%W cget -activebackground] - %W config -activebackground [%W cget -background] + %W configure -activebackground [%W cget -background] } %W activate [%W identify %x %y] } @@ -37,7 +37,7 @@ bind Scrollbar { bind Scrollbar { if {$tk_strictMotif && [info exists tk::Priv(activeBg)]} { - %W config -activebackground $tk::Priv(activeBg) + %W configure -activebackground $tk::Priv(activeBg) } %W activate {} } diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index cbc63a1..73efa58 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -11,7 +11,7 @@ # files by clicking on the file icons or by entering a filename # in the "Filename:" entry. # -# RCS: @(#) $Id: tkfbox.tcl,v 1.55 2006/01/25 18:22:04 dgp Exp $ +# RCS: @(#) $Id: tkfbox.tcl,v 1.56 2006/03/17 11:13:15 patthoyts Exp $ # # Copyright (c) 1994-1998 Sun Microsystems, Inc. # @@ -227,8 +227,8 @@ proc ::tk::IconList_Create {w} { pack $data(sbar) -side bottom -fill x -padx 2 pack $data(canvas) -expand yes -fill both - $data(sbar) config -command [list $data(canvas) xview] - $data(canvas) config -xscrollcommand [list $data(sbar) set] + $data(sbar) configure -command [list $data(canvas) xview] + $data(canvas) configure -xscrollcommand [list $data(sbar) set] # Initializes the max icon/text width and height and other variables # @@ -395,7 +395,7 @@ proc ::tk::IconList_Arrange {w} { if {![info exists data(list)]} { if {[info exists data(canvas)] && [winfo exists $data(canvas)]} { set data(noScroll) 1 - $data(sbar) config -command "" + $data(sbar) configure -command "" } return } @@ -451,13 +451,13 @@ proc ::tk::IconList_Arrange {w} { } if {$sW < $W} { - $data(canvas) config -scrollregion [list $pad $pad $sW $H] - $data(sbar) config -command "" + $data(canvas) configure -scrollregion [list $pad $pad $sW $H] + $data(sbar) configure -command "" $data(canvas) xview moveto 0 set data(noScroll) 1 } else { - $data(canvas) config -scrollregion [list $pad $pad $sW $H] - $data(sbar) config -command [list $data(canvas) xview] + $data(canvas) configure -scrollregion [list $pad $pad $sW $H] + $data(sbar) configure -command [list $data(canvas) xview] set data(noScroll) 0 } @@ -874,12 +874,12 @@ proc ::tk::dialog::file:: {type args} { -command [list ::tk::dialog::file::SetFilter $w $type] } SetFilter $w [lindex $data(-filetypes) 0] - $data(typeMenuBtn) config -state normal - $data(typeMenuLab) config -state normal + $data(typeMenuBtn) configure -state normal + $data(typeMenuLab) configure -state normal } else { set data(filter) "*" - $data(typeMenuBtn) config -state disabled -takefocus 0 - $data(typeMenuLab) config -state disabled + $data(typeMenuBtn) configure -state disabled -takefocus 0 + $data(typeMenuLab) configure -state disabled } UpdateWhenIdle $w @@ -1038,9 +1038,9 @@ static char updir_bits[] = { 0x10, 0xfe, 0x07, 0x01, 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01, 0xf0, 0xff, 0xff, 0x01};}] } - $data(upBtn) config -image $Priv(updirImage) + $data(upBtn) configure -image $Priv(updirImage) - $f1.menu config -takefocus 1 -highlightthickness 2 + $f1.menu configure -takefocus 1 -highlightthickness 2 pack $data(upBtn) -side right -padx 4 -fill both pack $f1.lab -side left -padx 4 -fill both @@ -1084,7 +1084,7 @@ static char updir_bits[] = { set data(typeMenuBtn) [menubutton $f2.menu -indicatoron 1 \ -menu $f2.menu.m] set data(typeMenu) [menu $data(typeMenuBtn).m -tearoff 0] - $data(typeMenuBtn) config -takefocus 1 -highlightthickness 2 \ + $data(typeMenuBtn) configure -takefocus 1 -highlightthickness 2 \ -relief raised -bd 2 -anchor w bind $data(typeMenuLab) <> [list \ focus $data(typeMenuBtn)] @@ -1139,8 +1139,8 @@ static char updir_bits[] = { # wm protocol $w WM_DELETE_WINDOW [list ::tk::dialog::file::CancelCmd $w] - $data(upBtn) config -command [list ::tk::dialog::file::UpDirCmd $w] - $data(cancelBtn) config -command [list ::tk::dialog::file::CancelCmd $w] + $data(upBtn) configure -command [list ::tk::dialog::file::UpDirCmd $w] + $data(cancelBtn) configure -command [list ::tk::dialog::file::CancelCmd $w] bind $w [list tk::ButtonInvoke $data(cancelBtn)] bind $w [list tk::AltKeyInDialog $w %A] @@ -1148,7 +1148,7 @@ static char updir_bits[] = { # if {$class eq "TkFDialog"} { bind $data(ent) [list ::tk::dialog::file::ActivateEnt $w] - $data(okBtn) config -command [list ::tk::dialog::file::OkCmd $w] + $data(okBtn) configure -command [list ::tk::dialog::file::OkCmd $w] bind $w [format { if {[%s cget -state] eq "normal"} { focus %s @@ -1157,7 +1157,7 @@ static char updir_bits[] = { } else { set okCmd [list ::tk::dialog::file::chooseDir::OkCmd $w] bind $data(ent) $okCmd - $data(okBtn) config -command $okCmd + $data(okBtn) configure -command $okCmd bind $w [list focus $data(ent)] bind $w [list tk::ButtonInvoke $data(okBtn)] } @@ -1269,8 +1269,8 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}] # set entCursor [$data(ent) cget -cursor] set dlgCursor [$w cget -cursor] - $data(ent) config -cursor watch - $w config -cursor watch + $data(ent) configure -cursor watch + $w configure -cursor watch update idletasks ::tk::IconList_DeleteAll $data(icons) @@ -1342,8 +1342,8 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}] # turn off the busy cursor. # - $data(ent) config -cursor $entCursor - $w config -cursor $dlgCursor + $data(ent) configure -cursor $entCursor + $w configure -cursor $dlgCursor } # ::tk::dialog::file::SetPathSilently -- @@ -1380,7 +1380,7 @@ proc ::tk::dialog::file::SetFilter {w type} { upvar ::tk::$data(icons) icons set data(filter) [lindex $type 1] - $data(typeMenuBtn) config -text [lindex $type 0] -indicatoron 1 + $data(typeMenuBtn) configure -text [lindex $type 0] -indicatoron 1 # If we aren't using a default extension, use the one suppled # by the filter. diff --git a/library/xmfbox.tcl b/library/xmfbox.tcl index 472aeb7..2e68a15 100644 --- a/library/xmfbox.tcl +++ b/library/xmfbox.tcl @@ -4,7 +4,7 @@ # Unix platform. This implementation is used only if the # "::tk_strictMotif" flag is set. # -# RCS: @(#) $Id: xmfbox.tcl,v 1.28 2006/01/25 18:22:04 dgp Exp $ +# RCS: @(#) $Id: xmfbox.tcl,v 1.29 2006/03/17 11:13:15 patthoyts Exp $ # # Copyright (c) 1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Scriptics Corporation @@ -327,9 +327,9 @@ proc ::tk::MotifFDialog_BuildUI {w} { -sticky news grid $f2b -row 0 -column 1 -rowspan 1 -columnspan 1 -padx 4 -pady 4 \ -sticky news - grid rowconfig $f2 0 -minsize 0 -weight 1 - grid columnconfig $f2 0 -minsize 0 -weight 1 - grid columnconfig $f2 1 -minsize 150 -weight 2 + grid rowconfigure $f2 0 -minsize 0 -weight 1 + grid columnconfigure $f2 0 -minsize 0 -weight 1 + grid columnconfigure $f2 1 -minsize 150 -weight 2 # The Filter box # @@ -425,9 +425,9 @@ proc ::tk::MotifFDialog_MakeSList {w f label cmdPrefix} { grid $f.v -row 1 -column 1 -rowspan 1 -columnspan 1 -sticky news grid $f.h -row 2 -column 0 -rowspan 1 -columnspan 1 -sticky news - grid rowconfig $f 0 -weight 0 -minsize 0 - grid rowconfig $f 1 -weight 1 -minsize 0 - grid columnconfig $f 0 -weight 1 -minsize 0 + grid rowconfigure $f 0 -weight 0 -minsize 0 + grid rowconfigure $f 1 -weight 1 -minsize 0 + grid columnconfigure $f 0 -weight 1 -minsize 0 # bindings for the listboxes # -- cgit v0.12