summaryrefslogtreecommitdiffstats
path: root/library/dialog.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)
commit911327e9df59424c6f3437b3fac76752e1ed0ccd (patch)
tree9b964605296b4f7dd7bd91a2baa6ebd8c0bf21bc /library/dialog.tcl
parent49f0f55d22ec2e4dc849f2e8e97299de2a3e6b44 (diff)
downloadtk-911327e9df59424c6f3437b3fac76752e1ed0ccd.zip
tk-911327e9df59424c6f3437b3fac76752e1ed0ccd.tar.gz
tk-911327e9df59424c6f3437b3fac76752e1ed0ccd.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/dialog.tcl')
-rw-r--r--library/dialog.tcl26
1 files changed, 13 insertions, 13 deletions
diff --git a/library/dialog.tcl b/library/dialog.tcl
index 3d64b4d..404593e 100644
--- a/library/dialog.tcl
+++ b/library/dialog.tcl
@@ -3,7 +3,7 @@
# This file defines the procedure tk_dialog, which creates a dialog
# box containing a bitmap, a message, and one or more buttons.
#
-# RCS: @(#) $Id: dialog.tcl,v 1.14.2.2 2005/10/05 04:14:19 hobbs Exp $
+# RCS: @(#) $Id: dialog.tcl,v 1.14.2.3 2006/01/25 18:21:41 dgp Exp $
#
# Copyright (c) 1992-1993 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -34,12 +34,13 @@ proc ::tk_dialog {w title text bitmap default args} {
variable ::tk::Priv
# Check that $default was properly given
- if {[string is int $default]} {
+ if {[string is integer -strict $default]} {
if {$default >= [llength $args]} {
return -code error "default button index greater than number of\
buttons specified for tk_dialog"
}
- } elseif {[string equal {} $default]} {
+ # Never call if -strict option is omitted in previous test !
+ } elseif {"" eq $default} {
set default -1
} else {
set default [lsearch -exact $args $default]
@@ -48,7 +49,7 @@ proc ::tk_dialog {w title text bitmap default args} {
# 1. Create the top-level window and divide it into top
# and bottom parts.
- catch {destroy $w}
+ destroy $w
toplevel $w -class Dialog
wm title $w $title
wm iconname $w Dialog
@@ -65,14 +66,15 @@ proc ::tk_dialog {w title text bitmap default args} {
wm transient $w [winfo toplevel [winfo parent $w]]
}
- if {[string equal $tcl_platform(platform) "macintosh"]
- || [string equal [tk windowingsystem] "aqua"]} {
+ set windowingsystem [tk windowingsystem]
+
+ if {$tcl_platform(platform) eq "macintosh" || $windowingsystem eq "aqua"} {
::tk::unsupported::MacWindowStyle style $w dBoxProc
}
frame $w.bot
frame $w.top
- if {[string equal [tk windowingsystem] "x11"]} {
+ if {$windowingsystem eq "x11"} {
$w.bot configure -relief raised -bd 1
$w.top configure -relief raised -bd 1
}
@@ -84,8 +86,7 @@ proc ::tk_dialog {w title text bitmap default args} {
# overridden by the caller).
option add *Dialog.msg.wrapLength 3i widgetDefault
- if {[string equal $tcl_platform(platform) "macintosh"]
- || [string equal [tk windowingsystem] "aqua"]} {
+ if {$tcl_platform(platform) eq "macintosh" || $windowingsystem eq "aqua"} {
option add *Dialog.msg.font system widgetDefault
} else {
option add *Dialog.msg.font {Times 12} widgetDefault
@@ -95,7 +96,7 @@ proc ::tk_dialog {w title text bitmap default args} {
pack $w.msg -in $w.top -side right -expand 1 -fill both -padx 3m -pady 3m
if {$bitmap ne ""} {
if {($tcl_platform(platform) eq "macintosh"
- || [tk windowingsystem] eq "aqua") && ($bitmap eq "error")} {
+ || $windowingsystem eq "aqua") && ($bitmap eq "error")} {
set bitmap "stop"
}
label $w.bitmap -bitmap $bitmap
@@ -116,10 +117,9 @@ proc ::tk_dialog {w title text bitmap default args} {
-padx 10 -pady 4
grid columnconfigure $w.bot $i
# We boost the size of some Mac buttons for l&f
- if {[string equal $tcl_platform(platform) "macintosh"]
- || [string equal [tk windowingsystem] "aqua"]} {
+ if {$tcl_platform(platform) eq "macintosh" || $windowingsystem eq "aqua"} {
set tmp [string tolower $but]
- if {[string equal $tmp "ok"] || [string equal $tmp "cancel"]} {
+ if {$tmp eq "ok" || $tmp eq "cancel"} {
grid columnconfigure $w.bot $i -minsize [expr {59 + 20}]
}
}