diff options
author | hobbs <hobbs> | 1999-09-02 17:02:52 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 1999-09-02 17:02:52 (GMT) |
commit | 2abe00f21824a55ee6096189dc4979ca29af2e2e (patch) | |
tree | ccf3e977fda229d63d171853a7b5e3c8e3564996 /library/dialog.tcl | |
parent | b598f1d55d8f6a4aefb4d53d8639f8f04bf94cf2 (diff) | |
download | tk-2abe00f21824a55ee6096189dc4979ca29af2e2e.zip tk-2abe00f21824a55ee6096189dc4979ca29af2e2e.tar.gz tk-2abe00f21824a55ee6096189dc4979ca29af2e2e.tar.bz2 |
1999-09-01 Jeff Hobbs <hobbs@scriptics.com>
* library/msgbox.tcl: changed the behavior of tk_messageBox on
Unix to be more Windows like in handling of <Return> and the
default button
* library/button.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/safetk.tcl:
* library/scale.tcl:
* library/scrlbar.tcl:
* library/tearoff.tcl:
* library/text.tcl:
* library/tk.tcl:
* library/tkfbox.tcl:
* library/xmfbox.tcl: updated commands to use [string] ops
instead of expr equality operators
Diffstat (limited to 'library/dialog.tcl')
-rw-r--r-- | library/dialog.tcl | 27 |
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 " } |