Tk Library Source Code

Artifact [68974f3e64]
Login

Artifact 68974f3e64e38630e2aa6c8f81415418024008ed:

Attachment "bwidget-tip-278.diff" to ticket [1579744fff] added by jonne_z 2006-10-18 21:36:11.
--- BWidget-1.7.0/widget.tcl	2006-10-18 11:07:38.000000000 +0200
+++ widget.tcl	2006-10-18 16:25:12.000000000 +0200
@@ -1,7 +1,7 @@
 # ----------------------------------------------------------------------------
 #  widget.tcl
 #  This file is part of Unifix BWidget Toolkit
-#  $Id: widget.tcl 5686 2005-12-29 14:11:56Z lephilousophe $
+#  $Id: widget.tcl 7368 2006-10-18 14:24:58Z jonne_z $
 # ----------------------------------------------------------------------------
 #  Index of commands:
 #     - Widget::tkinclude
@@ -475,6 +475,8 @@
 # ----------------------------------------------------------------------------
 proc Widget::init { class path options } {
     variable _inuse
+	variable _class
+	variable _optiontype
 
     upvar 0 ${class}::opt classopt
     upvar 0 ${class}::$path:opt  pathopt
@@ -525,7 +527,7 @@
     if {![info exists _inuse($class)]} { set _inuse($class) 0 }
     incr _inuse($class)
 
-    set Widget::_class($path) $class
+    set _class($path) $class
     foreach {option value} $options {
         if { ![info exists classopt($option)] } {
             unset pathopt
@@ -539,7 +541,7 @@
             set optdesc $classopt($option)
             set type    [lindex $optdesc 0]
         }
-        set pathopt($option) [$Widget::_optiontype($type) $option $value [lindex $optdesc 3]]
+        set pathopt($option) [$_optiontype($type) $option $value [lindex $optdesc 3]]
 	set pathinit($option) $pathopt($option)
     }
 }
@@ -562,6 +564,8 @@
 #  Command Widget::copyinit
 # ----------------------------------------------------------------------------
 proc Widget::copyinit { class templatepath path options } {
+	variable _class
+	variable _optiontype
     upvar 0 ${class}::opt classopt \
 	    ${class}::$path:opt	 pathopt \
 	    ${class}::$path:mod	 pathmod \
@@ -582,7 +586,7 @@
     array set pathopt  [array get templatepathopt]
     array set pathinit [array get templatepathinit]
 
-    set Widget::_class($path) $class
+    set _class($path) $class
     foreach {option value} $options {
 	if { ![info exists classopt($option)] } {
 	    unset pathopt
@@ -596,7 +600,7 @@
 	    set optdesc $classopt($option)
 	    set type	[lindex $optdesc 0]
 	}
-	set pathopt($option) [$Widget::_optiontype($type) $option $value [lindex $optdesc 3]]
+	set pathopt($option) [$_optiontype($type) $option $value [lindex $optdesc 3]]
 	set pathinit($option) $pathopt($option)
     }
 }
@@ -618,6 +622,7 @@
 #		the command line in which that portion is interested.
 
 proc Widget::parseArgs {class options} {
+	variable _optiontype
     upvar 0 ${class}::opt classopt
     upvar 0 ${class}::map classmap
     
@@ -636,7 +641,7 @@
 	    # Make sure that the widget used for this TkResource exists
 	    Widget::_get_tkwidget_options [lindex [lindex $optdesc 3] 0]
 	}
-	set val [$Widget::_optiontype($type) $option $val [lindex $optdesc 3]]
+	set val [$_optiontype($type) $option $val [lindex $optdesc 3]]
 		
 	if { [info exists classmap($option)] } {
 	    foreach {subpath subclass realopt} $classmap($option) {
@@ -817,11 +822,12 @@
 #  Command Widget::cget
 # ----------------------------------------------------------------------------
 proc Widget::cget { path option } {
+	variable _class
     if { ![info exists ::Widget::_class($path)] } {
         return -code error "unknown widget $path"
     }
 
-    set class $::Widget::_class($path)
+    set class $_class($path)
     if { ![info exists ${class}::opt($option)] } {
         return -code error "unknown option \"$option\""
     }
@@ -846,7 +852,8 @@
 #  Command Widget::subcget
 # ----------------------------------------------------------------------------
 proc Widget::subcget { path subwidget } {
-    set class $::Widget::_class($path)
+	variable _class
+    set class $_class($path)
     upvar 0 ${class}::$path:opt pathopt
     upvar 0 ${class}::map$subwidget submap
     upvar 0 ${class}::$path:init pathinit
@@ -865,8 +872,9 @@
 #  Command Widget::hasChanged
 # ----------------------------------------------------------------------------
 proc Widget::hasChanged { path option pvalue } {
+	variable _class
     upvar    $pvalue value
-    set class $::Widget::_class($path)
+    set class $_class($path)
     upvar 0 ${class}::$path:mod pathmod
 
     set value   [Widget::cget $path $option]
@@ -877,7 +885,8 @@
 }
 
 proc Widget::hasChangedX { path option args } {
-    set class $::Widget::_class($path)
+	variable _class
+    set class $_class($path)
     upvar 0 ${class}::$path:mod pathmod
 
     set result  $pathmod($option)
@@ -930,7 +939,8 @@
 #	value	option value.
 
 proc Widget::getMegawidgetOption {path option} {
-    set class $::Widget::_class($path)
+	variable _class
+    set class $_class($path)
     upvar 0 ${class}::${path}:opt pathopt
     set pathopt($option)
 }
@@ -950,7 +960,8 @@
 #	value	option value.
 
 proc Widget::setMegawidgetOption {path option value} {
-    set class $::Widget::_class($path)
+	variable _class
+    set class $_class($path)
     upvar 0 ${class}::${path}:opt pathopt
     set pathopt($option) $value
 }