diff options
author | dgp <dgp@users.sourceforge.net> | 2006-01-25 18:22:04 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2006-01-25 18:22:04 (GMT) |
commit | 339966aea87195faf678c05a06895a0a2f9c65af (patch) | |
tree | 80bb0c008e169df663722d227f5f24bc18665bac /library/dialog.tcl | |
parent | f59975d6eb39f7419c93e45392bab264f83ac352 (diff) | |
download | tk-339966aea87195faf678c05a06895a0a2f9c65af.zip tk-339966aea87195faf678c05a06895a0a2f9c65af.tar.gz tk-339966aea87195faf678c05a06895a0a2f9c65af.tar.bz2 |
* library/bgerror.tcl: Updates to use Tcl 8.4 features. [Patch 1237759] * library/choosedir.tcl:
* library/comdlg.tcl:
* library/console.tcl:
* library/dialog.tcl:
* library/focus.tcl:
* library/msgbox.tcl:
* library/palette.tcl:
* library/tk.tcl:
* library/tkfbox.tcl:
* library/xmfbox.tcl:
Diffstat (limited to 'library/dialog.tcl')
-rw-r--r-- | library/dialog.tcl | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/library/dialog.tcl b/library/dialog.tcl index 92d9770..e4a1ec5 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.19 2005/10/05 04:14:10 hobbs Exp $ +# RCS: @(#) $Id: dialog.tcl,v 1.20 2006/01/25 18:22:04 dgp Exp $ # # Copyright (c) 1992-1993 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -34,7 +34,7 @@ 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" @@ -48,7 +48,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,13 +65,14 @@ proc ::tk_dialog {w title text bitmap default args} { wm transient $w [winfo toplevel [winfo parent $w]] } - if {[tk windowingsystem] eq "aqua"} { + set windowingsystem [tk windowingsystem] + if {$windowingsystem eq "aqua"} { ::tk::unsupported::MacWindowStyle style $w dBoxProc } frame $w.bot frame $w.top - if {[tk windowingsystem] eq "x11"} { + if {$windowingsystem eq "x11"} { $w.bot configure -relief raised -bd 1 $w.top configure -relief raised -bd 1 } @@ -84,7 +85,7 @@ proc ::tk_dialog {w title text bitmap default args} { # overridden by the caller). option add *Dialog.msg.wrapLength 3i widgetDefault - if {[tk windowingsystem] eq "aqua"} { + if {$windowingsystem eq "aqua"} { option add *Dialog.msg.font system widgetDefault } else { option add *Dialog.msg.font {Times 12} widgetDefault @@ -93,7 +94,7 @@ proc ::tk_dialog {w title text bitmap default args} { label $w.msg -justify left -text $text pack $w.msg -in $w.top -side right -expand 1 -fill both -padx 3m -pady 3m if {$bitmap ne ""} { - if {[tk windowingsystem] eq "aqua" && $bitmap eq "error"} { + if {$windowingsystem eq "aqua" && $bitmap eq "error"} { set bitmap "stop" } label $w.bitmap -bitmap $bitmap @@ -114,7 +115,7 @@ 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 {[tk windowingsystem] eq "aqua"} { + if {$windowingsystem eq "aqua"} { set tmp [string tolower $but] if {$tmp eq "ok" || $tmp eq "cancel"} { grid columnconfigure $w.bot $i -minsize [expr {59 + 20}] |