summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmax <rmax>2002-07-17 16:51:52 (GMT)
committerrmax <rmax>2002-07-17 16:51:52 (GMT)
commit30a54fbc60fe36513ad43e4839cfefdd08f5c8f1 (patch)
treea63fcae4ab11d920b6d40fa3e633832f13d9f472
parent0e402af04c7c6a2e9c67e2783bff5eae785773ed (diff)
downloadtk-30a54fbc60fe36513ad43e4839cfefdd08f5c8f1.zip
tk-30a54fbc60fe36513ad43e4839cfefdd08f5c8f1.tar.gz
tk-30a54fbc60fe36513ad43e4839cfefdd08f5c8f1.tar.bz2
* library/unsupported.tcl: Extended ExposePrivateVariable, and
ExposePrivateCommand to accept patterns as well.
-rw-r--r--ChangeLog5
-rw-r--r--library/unsupported.tcl24
2 files changed, 21 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 13b4501..2f0247f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-07-17 Reinhard Max <max@suse.de>
+
+ * library/unsupported.tcl: Extended ExposePrivateVariable, and
+ ExposePrivateCommand to accept patterns as well.
+
2002-07-17 Don Porter <dgp@users.sf.net>
* generic/tkFont.c: Corrected reversed logic in assert -> panic
diff --git a/library/unsupported.tcl b/library/unsupported.tcl
index d1eb5a8..72171c3 100644
--- a/library/unsupported.tcl
+++ b/library/unsupported.tcl
@@ -3,7 +3,7 @@
# Commands provided by Tk without official support. Use them at your
# own risk. They may change or go away without notice.
#
-# RCS: @(#) $Id: unsupported.tcl,v 1.3 2001/08/06 18:29:41 dgp Exp $
+# RCS: @(#) $Id: unsupported.tcl,v 1.4 2002/07/17 16:51:53 rmax Exp $
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -247,7 +247,8 @@ namespace eval ::tk::unsupported {
# old global name
#
# Arguments:
-# cmd Global name by which the command was once known
+# cmd Global name by which the command was once known,
+# or a glob-style pattern.
#
# Results:
# None.
@@ -258,10 +259,13 @@ namespace eval ::tk::unsupported {
proc ::tk::unsupported::ExposePrivateCommand {cmd} {
variable PrivateCommands
- if {![info exists PrivateCommands($cmd)]} {
+ set cmds [array get PrivateCommands $cmd]
+ if {[llength $cmds] == 0} {
return -code error "No compatibility support for \[$cmd]"
}
- namespace eval :: [list interp alias {} $cmd {}] $PrivateCommands($cmd)
+ foreach {old new} $cmds {
+ namespace eval :: [list interp alias {} $old {}] $new
+ }
}
# ::tk::unsupported::ExposePrivateVariable --
@@ -270,7 +274,8 @@ proc ::tk::unsupported::ExposePrivateCommand {cmd} {
# old global name
#
# Arguments:
-# var Global name by which the variable was once known
+# var Global name by which the variable was once known,
+# or a glob-style pattern.
#
# Results:
# None.
@@ -281,9 +286,12 @@ proc ::tk::unsupported::ExposePrivateCommand {cmd} {
proc ::tk::unsupported::ExposePrivateVariable {var} {
variable PrivateVariables
- if {![info exists PrivateVariables($var)]} {
+ set vars [array get PrivateVariables $var]
+ if {[llength $vars] == 0} {
return -code error "No compatibility support for \$$var"
}
- namespace eval :: [list upvar #0 $PrivateVariables($var) $var]
+ namespace eval ::tk::mac {}
+ foreach {old new} $vars {
+ namespace eval :: [list upvar "#0" $new $old]
+ }
}
-