summaryrefslogtreecommitdiffstats
path: root/library/dialog.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2001-08-01 16:21:11 (GMT)
committerdgp <dgp@users.sourceforge.net>2001-08-01 16:21:11 (GMT)
commit98ea3cb2214b51432f38f6ea50c1c429397281cc (patch)
tree38846cbe94cc8aac068898282ced4624f130770e /library/dialog.tcl
parent7e9aececf720b6f0e20157366f8e977ad2378ddd (diff)
downloadtk-98ea3cb2214b51432f38f6ea50c1c429397281cc.zip
tk-98ea3cb2214b51432f38f6ea50c1c429397281cc.tar.gz
tk-98ea3cb2214b51432f38f6ea50c1c429397281cc.tar.bz2
Merged changes from feature branch dgp-privates-into-namespace,
implementing TIP 44. All Tk commands and variables matching tk[A-Z]* are now in the ::tk namespace.
Diffstat (limited to 'library/dialog.tcl')
-rw-r--r--library/dialog.tcl21
1 files changed, 11 insertions, 10 deletions
diff --git a/library/dialog.tcl b/library/dialog.tcl
index b3c9dbd..534a9ae 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.8 2000/04/18 02:18:33 ericm Exp $
+# RCS: @(#) $Id: dialog.tcl,v 1.9 2001/08/01 16:21:11 dgp Exp $
#
# Copyright (c) 1992-1993 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -13,7 +13,7 @@
#
#
-# tk_dialog:
+# ::tk_dialog:
#
# This procedure displays a dialog box, waits for a button in the dialog
# to be invoked, then returns the index of the selected button. If the
@@ -29,8 +29,9 @@
# args - One or more strings to display in buttons across the
# bottom of the dialog box.
-proc tk_dialog {w title text bitmap default args} {
- global tkPriv tcl_platform
+proc ::tk_dialog {w title text bitmap default args} {
+ global tcl_platform
+ variable ::tk::Priv
# Check that $default was properly given
if {[string is int $default]} {
@@ -103,7 +104,7 @@ proc tk_dialog {w title text bitmap default args} {
set i 0
foreach but $args {
- button $w.button$i -text $but -command [list set tkPriv(button) $i]
+ button $w.button$i -text $but -command [list set Priv(button) $i]
if {$i == $default} {
$w.button$i configure -default active
} else {
@@ -129,7 +130,7 @@ proc tk_dialog {w title text bitmap default args} {
[list $w.button$default] configure -state active -relief sunken
update idletasks
after 100
- set tkPriv(button) $default
+ set Priv(button) $default
"
}
@@ -137,7 +138,7 @@ proc tk_dialog {w title text bitmap default args} {
# button variable to -1; this is needed in case something happens
# that destroys the window, such as its parent window being destroyed.
- bind $w <Destroy> {set tkPriv(button) -1}
+ bind $w <Destroy> {set Priv(button) -1}
# 6. Withdraw the window, then update all the geometry information
# so we know how big it wants to be, then center the window in the
@@ -172,12 +173,12 @@ proc tk_dialog {w title text bitmap default 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)
catch {focus $oldFocus}
catch {
# It's possible that the window has already been destroyed,
# hence this "catch". Delete the Destroy handler so that
- # tkPriv(button) doesn't get reset by it.
+ # tk::Priv(button) doesn't get reset by it.
bind $w <Destroy> {}
destroy $w
@@ -189,5 +190,5 @@ proc tk_dialog {w title text bitmap default args} {
grab -global $oldGrab
}
}
- return $tkPriv(button)
+ return $Priv(button)
}