diff options
author | hobbs <hobbs> | 2002-04-06 01:02:01 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-04-06 01:02:01 (GMT) |
commit | 831cfe0ab9eec7d3e38c8bab63fc5102ba9e3581 (patch) | |
tree | 3dbf5e1bb6c864181f7317bc670658667ec0a732 /library/msgbox.tcl | |
parent | 68d733180dac513267f82dbc54ab46b3788426e3 (diff) | |
download | tk-core_8_4_win_speedup.zip tk-core_8_4_win_speedup.tar.gz tk-core_8_4_win_speedup.tar.bz2 |
update to head
core_8_4_win_speedup
Diffstat (limited to 'library/msgbox.tcl')
-rw-r--r-- | library/msgbox.tcl | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/library/msgbox.tcl b/library/msgbox.tcl index 1ed1acc..575f73a 100644 --- a/library/msgbox.tcl +++ b/library/msgbox.tcl @@ -3,7 +3,7 @@ # Implements messageboxes for platforms that do not have native # messagebox support. # -# RCS: @(#) $Id: msgbox.tcl,v 1.12 2000/06/30 06:38:38 ericm Exp $ +# RCS: @(#) $Id: msgbox.tcl,v 1.12.2.1 2002/04/06 01:02:01 hobbs Exp $ # # Copyright (c) 1994-1997 Sun Microsystems, Inc. # @@ -114,7 +114,7 @@ static unsigned char w3_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};" -# tkMessageBox -- +# ::tk::MessageBox -- # # Pops up a messagebox with an application-supplied message with # an icon and a list of buttons. This procedure will be called @@ -130,11 +130,12 @@ static unsigned char w3_bits[] = { # # See the user documentation for details on what tk_messageBox does. # -proc tkMessageBox {args} { - global tkPriv tcl_platform tk_strictMotif +proc ::tk::MessageBox {args} { + global tcl_platform tk_strictMotif + variable ::tk::Priv - set w tkPrivMsgBox - upvar #0 $w data + set w ::tk::PrivMsgBox + upvar $w data # # The default value of the title is space (" ") not the empty string @@ -170,8 +171,8 @@ proc tkMessageBox {args} { switch -- $data(-type) { abortretryignore { - set maxWidth [::msgcat::mcmax Abort Retry Ignore] - set maxWidth [expr $maxWidth<6?6:$maxWidth] + set maxWidth [::msgcat::mcmax Abort Retry Ignore] + set maxWidth [expr {$maxWidth<6?6:$maxWidth}] set buttons [list \ [list abort -width $maxWidth -text [::msgcat::mc "Abort"] \ -under 0]\ @@ -191,8 +192,8 @@ proc tkMessageBox {args} { } } okcancel { - set maxWidth [::msgcat::mcmax OK Cancel] - set maxWidth [expr $maxWidth<6?6:$maxWidth] + set maxWidth [::msgcat::mcmax OK Cancel] + set maxWidth [expr {$maxWidth<6?6:$maxWidth}] set buttons [list \ [list ok -width $maxWidth \ -text [::msgcat::mc "OK"] -under 0] \ @@ -201,8 +202,8 @@ proc tkMessageBox {args} { ] } retrycancel { - set maxWidth [::msgcat::mcmax Retry Cancel] - set maxWidth [expr $maxWidth<6?6:$maxWidth] + set maxWidth [::msgcat::mcmax Retry Cancel] + set maxWidth [expr {$maxWidth<6?6:$maxWidth}] set buttons [list \ [list retry -width $maxWidth \ -text [::msgcat::mc "Retry"] -under 0] \ @@ -211,8 +212,8 @@ proc tkMessageBox {args} { ] } yesno { - set maxWidth [::msgcat::mcmax Yes No] - set maxWidth [expr $maxWidth<6?6:$maxWidth] + set maxWidth [::msgcat::mcmax Yes No] + set maxWidth [expr {$maxWidth<6?6:$maxWidth}] set buttons [list \ [list yes -width $maxWidth \ -text [::msgcat::mc "Yes"] -under 0]\ @@ -221,8 +222,8 @@ proc tkMessageBox {args} { ] } yesnocancel { - set maxWidth [::msgcat::mcmax Yes No Cancel] - set maxWidth [expr $maxWidth<6?6:$maxWidth] + set maxWidth [::msgcat::mcmax Yes No Cancel] + set maxWidth [expr {$maxWidth<6?6:$maxWidth}] set buttons [list \ [list yes -width $maxWidth \ -text [::msgcat::mc "Yes"] -under 0]\ @@ -285,7 +286,7 @@ proc tkMessageBox {args} { } if {[string equal $tcl_platform(platform) "macintosh"]} { - unsupported1 style $w dBoxProc + unsupported::MacWindowStyle style $w dBoxProc } frame $w.bot @@ -364,7 +365,7 @@ proc tkMessageBox {args} { set opts [list -text $capName] } - eval button [list $w.$name] $opts [list -command [list set tkPriv(button) $name]] + eval button [list $w.$name] $opts [list -command [list set tk::Priv(button) $name]] if {[string equal $name $data(-default)]} { $w.$name configure -default active @@ -399,7 +400,7 @@ proc tkMessageBox {args} { bind $w <Return> { if {[string equal Button [winfo class %W]]} { - tkButtonInvoke %W + tk::ButtonInvoke %W } } @@ -424,9 +425,9 @@ proc tkMessageBox {args} { # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. - tkwait variable tkPriv(button) + vwait ::tk::Priv(button) ::tk::RestoreFocusGrab $w $focus - return $tkPriv(button) + return $Priv(button) } |