summaryrefslogtreecommitdiffstats
path: root/library/listbox.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-01-25 18:21:40 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-01-25 18:21:40 (GMT)
commitee09dd0c7cfc65378fac95dd53067bcd72b390e9 (patch)
tree9b964605296b4f7dd7bd91a2baa6ebd8c0bf21bc /library/listbox.tcl
parent2a147ca9e8cdff6b06499b16942dd0a9b8b92228 (diff)
downloadtk-ee09dd0c7cfc65378fac95dd53067bcd72b390e9.zip
tk-ee09dd0c7cfc65378fac95dd53067bcd72b390e9.tar.gz
tk-ee09dd0c7cfc65378fac95dd53067bcd72b390e9.tar.bz2
* library/bgerror.tcl: Updates to use Tcl 8.4 features. [Patch 1237759] * library/button.tcl:
* library/choosedir.tcl: * library/clrpick.tcl: * library/comdlg.tcl: * library/console.tcl: * library/dialog.tcl: * library/entry.tcl: * library/focus.tcl: * library/listbox.tcl: * library/menu.tcl: * library/msgbox.tcl: * library/palette.tcl: * library/panedwindow.tcl: * library/safetk.tcl: * library/scale.tcl: * library/scrlbar.tcl: * library/spinbox.tcl: * library/tearoff.tcl: * library/text.tcl: * library/tk.tcl: * library/tkfbox.tcl: * library/xmfbox.tcl:
Diffstat (limited to 'library/listbox.tcl')
-rw-r--r--library/listbox.tcl32
1 files changed, 15 insertions, 17 deletions
diff --git a/library/listbox.tcl b/library/listbox.tcl
index 5cec546..fb5c47b 100644
--- a/library/listbox.tcl
+++ b/library/listbox.tcl
@@ -3,7 +3,7 @@
# This file defines the default bindings for Tk listbox widgets
# and provides procedures that help in implementing those bindings.
#
-# RCS: @(#) $Id: listbox.tcl,v 1.13.2.3 2005/09/10 14:54:17 das Exp $
+# RCS: @(#) $Id: listbox.tcl,v 1.13.2.4 2006/01/25 18:21:41 dgp Exp $
#
# Copyright (c) 1994 The Regents of the University of California.
# Copyright (c) 1994-1995 Sun Microsystems, Inc.
@@ -136,7 +136,7 @@ bind Listbox <Shift-Control-End> {
tk::ListboxDataExtend %W [%W index end]
}
bind Listbox <<Copy>> {
- if {[string equal [selection own -displayof %W] "%W"]} {
+ if {[selection own -displayof %W] eq "%W"} {
clipboard clear -displayof %W
clipboard append -displayof %W [selection get -displayof %W]
}
@@ -160,7 +160,7 @@ bind Listbox <Control-slash> {
tk::ListboxSelectAll %W
}
bind Listbox <Control-backslash> {
- if {[string compare [%W cget -selectmode] "browse"]} {
+ if {[%W cget -selectmode] ne "browse"} {
%W selection clear 0 end
event generate %W <<ListboxSelect>>
}
@@ -178,9 +178,7 @@ bind Listbox <B2-Motion> {
# The MouseWheel will typically only fire on Windows and Mac OS X.
# However, someone could use the "event generate" command to produce
# one on other platforms.
-
-if {[string equal [tk windowingsystem] "classic"]
- || [string equal [tk windowingsystem] "aqua"]} {
+if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D)}] units
}
@@ -199,7 +197,7 @@ if {[string equal [tk windowingsystem] "classic"]
}
}
-if {[string equal "x11" [tk windowingsystem]]} {
+if {"x11" eq [tk windowingsystem]} {
# Support for mousewheels on Linux/Unix commonly comes through mapping
# the wheel to the extended buttons. If you have a mousewheel, find
# Linux configuration info at:
@@ -230,7 +228,7 @@ if {[string equal "x11" [tk windowingsystem]]} {
proc ::tk::ListboxBeginSelect {w el} {
variable ::tk::Priv
- if {[string equal [$w cget -selectmode] "multiple"]} {
+ if {[$w cget -selectmode] eq "multiple"} {
if {[$w selection includes $el]} {
$w selection clear $el
} else {
@@ -271,7 +269,7 @@ proc ::tk::ListboxMotion {w el} {
}
extended {
set i $Priv(listboxPrev)
- if {[string equal {} $i]} {
+ if {$i eq ""} {
set i $el
$w selection set $el
}
@@ -316,7 +314,7 @@ proc ::tk::ListboxMotion {w el} {
# one under the pointer). Must be in numerical form.
proc ::tk::ListboxBeginExtend {w el} {
- if {[string equal [$w cget -selectmode] "extended"]} {
+ if {[$w cget -selectmode] eq "extended"} {
if {[$w selection includes anchor]} {
ListboxMotion $w $el
} else {
@@ -340,7 +338,7 @@ proc ::tk::ListboxBeginExtend {w el} {
proc ::tk::ListboxBeginToggle {w el} {
variable ::tk::Priv
- if {[string equal [$w cget -selectmode] "extended"]} {
+ if {[$w cget -selectmode] eq "extended"} {
set Priv(listboxSelection) [$w curselection]
set Priv(listboxPrev) $el
$w selection anchor $el
@@ -426,7 +424,7 @@ proc ::tk::ListboxUpDown {w amount} {
proc ::tk::ListboxExtendUpDown {w amount} {
variable ::tk::Priv
- if {[string compare [$w cget -selectmode] "extended"]} {
+ if {[$w cget -selectmode] ne "extended"} {
return
}
set active [$w index active]
@@ -452,13 +450,13 @@ proc ::tk::ListboxExtendUpDown {w amount} {
proc ::tk::ListboxDataExtend {w el} {
set mode [$w cget -selectmode]
- if {[string equal $mode "extended"]} {
+ if {$mode eq "extended"} {
$w activate $el
$w see $el
if {[$w selection includes anchor]} {
ListboxMotion $w $el
}
- } elseif {[string equal $mode "multiple"]} {
+ } elseif {$mode eq "multiple"} {
$w activate $el
$w see $el
}
@@ -476,12 +474,12 @@ proc ::tk::ListboxDataExtend {w el} {
proc ::tk::ListboxCancel w {
variable ::tk::Priv
- if {[string compare [$w cget -selectmode] "extended"]} {
+ if {[$w cget -selectmode] ne "extended"} {
return
}
set first [$w index anchor]
set last $Priv(listboxPrev)
- if { [string equal $last ""] } {
+ if { $last eq "" } {
# Not actually doing any selection right now
return
}
@@ -511,7 +509,7 @@ proc ::tk::ListboxCancel w {
proc ::tk::ListboxSelectAll w {
set mode [$w cget -selectmode]
- if {[string equal $mode "single"] || [string equal $mode "browse"]} {
+ if {$mode eq "single" || $mode eq "browse"} {
$w selection clear 0 end
$w selection set active
} else {