diff options
author | dgp@users.sourceforge.net <dgp> | 2006-01-25 18:21:40 (GMT) |
---|---|---|
committer | dgp@users.sourceforge.net <dgp> | 2006-01-25 18:21:40 (GMT) |
commit | f78aebc2f0f95c1862d03902a4c80e8adbe627f0 (patch) | |
tree | 9b964605296b4f7dd7bd91a2baa6ebd8c0bf21bc /library/dialog.tcl | |
parent | 95d418b3c0c2e261f667e308cd6f571ce82a505a (diff) | |
download | tk-f78aebc2f0f95c1862d03902a4c80e8adbe627f0.zip tk-f78aebc2f0f95c1862d03902a4c80e8adbe627f0.tar.gz tk-f78aebc2f0f95c1862d03902a4c80e8adbe627f0.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.tcl | 26 |
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}] } } |