summaryrefslogtreecommitdiffstats
path: root/library/dialog.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/dialog.tcl')
-rw-r--r--library/dialog.tcl27
1 files changed, 14 insertions, 13 deletions
diff --git a/library/dialog.tcl b/library/dialog.tcl
index be5a81e..b46aa1e 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.4 1999/04/16 01:51:26 stanton Exp $
+# RCS: @(#) $Id: dialog.tcl,v 1.5 1999/09/02 17:02:52 hobbs Exp $
#
# Copyright (c) 1992-1993 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -47,13 +47,13 @@ proc tk_dialog {w title text bitmap default args} {
# even though its grab keeps the rest of the application from being used.
wm transient $w [winfo toplevel [winfo parent $w]]
- if {![string compare $tcl_platform(platform) "macintosh"]} {
+ if {[string equal $tcl_platform(platform) "macintosh"]} {
unsupported1 style $w dBoxProc
}
frame $w.bot
frame $w.top
- if {![string compare $tcl_platform(platform) "unix"]} {
+ if {[string equal $tcl_platform(platform) "unix"]} {
$w.bot configure -relief raised -bd 1
$w.top configure -relief raised -bd 1
}
@@ -65,7 +65,7 @@ proc tk_dialog {w title text bitmap default args} {
# overridden by the caller).
option add *Dialog.msg.wrapLength 3i widgetDefault
- if {![string compare $tcl_platform(platform) "macintosh"]} {
+ if {[string equal $tcl_platform(platform) "macintosh"]} {
option add *Dialog.msg.font system widgetDefault
} else {
option add *Dialog.msg.font {Times 18} widgetDefault
@@ -74,7 +74,8 @@ 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 {[string compare $bitmap ""]} {
- if {![string compare $tcl_platform(platform) "macintosh"] && ![string compare $bitmap "error"]} {
+ if {[string equal $tcl_platform(platform) "macintosh"] && \
+ [string equal $bitmap "error"]} {
set bitmap "stop"
}
label $w.bitmap -bitmap $bitmap
@@ -85,7 +86,7 @@ proc tk_dialog {w title text bitmap default args} {
set i 0
foreach but $args {
- button $w.button$i -text $but -command "set tkPriv(button) $i"
+ button $w.button$i -text $but -command [list set tkPriv(button) $i]
if {$i == $default} {
$w.button$i configure -default active
} else {
@@ -94,10 +95,10 @@ proc tk_dialog {w title text bitmap default args} {
grid $w.button$i -in $w.bot -column $i -row 0 -sticky ew -padx 10
grid columnconfigure $w.bot $i
# We boost the size of some Mac buttons for l&f
- if {![string compare $tcl_platform(platform) "macintosh"]} {
+ if {[string equal $tcl_platform(platform) "macintosh"]} {
set tmp [string tolower $but]
- if {![string compare $tmp "ok"] || ![string compare $tmp "cancel"]} {
- grid columnconfigure $w.bot $i -minsize [expr 59 + 20]
+ if {[string equal $tmp "ok"] || [string equal $tmp "cancel"]} {
+ grid columnconfigure $w.bot $i -minsize [expr {59 + 20}]
}
}
incr i
@@ -108,10 +109,10 @@ proc tk_dialog {w title text bitmap default args} {
if {$default >= 0} {
bind $w <Return> "
- [list $w.button$default] configure -state active -relief sunken
- update idletasks
- after 100
- set tkPriv(button) $default
+ [list $w.button$default] configure -state active -relief sunken
+ update idletasks
+ after 100
+ set tkPriv(button) $default
"
}