Skip to content
Tcl Source Code History Of Ticket 217948
Login

History Of Ticket 217948

Artifacts Associated With Ticket 217948

  1. Ticket change [73dd199eb6] (rid 105107) by nobody on 2000-10-26 00:46:29:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 3917 Bug
      Version: 8.2.1
      SubmitDate: '1999-12-21'
      LastModified: '2000-01-20'
      Severity: MED
      Status: Closed
      Submitter: techsupp
      ChangedBy: ericm
      RelatedBugIDs: 1433
      OS: Linux
      OSVersion: 2.0.37
      Machine: 166 AMD 128M ram 19 Gig HD.
      FixedDate: '2000-10-25'
      ClosedDate: '2000-01-20'
      
      
      Name:
      Kenn Persinger
      
      Comments:
      Tcl is the greatest scripting language i've found.. I program in perl at work since its the company standard, but when i go home to program for fun, tcl is what i use. you guys have done a wonderful job.
      
      ReproducibleScript:
      #this sets up the array
      
      ################################
      # Sets Up the Cursor Handling  #
      ################################
      proc InitPointerArray {} {
          uplevel #0 {
              array set Pointer "x {} y {}"
              trace variable Pointer rwu SetPointerXY
          }
      }
      
      # This one sets the values.
      # each time its called, it updates the values.
      proc SetPointerXY {args} {
          uplevel #0 {
              set Pointer(x) [winfo pointerx .] 
              set Pointer(y) [winfo pointery .]
          }
      }
      
      #This GetVar fails to execute the trace. ie: GetVar1 Pointer(x)
      proc GetVar1 {varname} {
          upvar #0 $varname myvar
          return $myvar
      }
      
      # This one also Fails. ie: GetVar2 Pointer(x)
      proc GetVar2 {varname} {
          global $varname
          return $varname
      }
      
      # This GetVar works perfect
      proc GetVar3 {varname} {
       return [uplevel #0 set $varname]
      }
      
      InitPointerAraay
      SetPointerXY ""
      
      puts "This one fails"
      GetVar1 Pointer(x)
      puts "This one also fails"
      GetVar2 Pointer(x)
      puts "This one is correct"
      GetVar3 Pointer(x)
      
      ObservedBehavior:
      I have an array w/ two values, the X and Y of the mouse pointer
      
       i've set a trace on them so that anytime they are read, the trace executes, and updates the value (nicely, before the read)
      
       i created a proc called GetVar <varname> and use it to allow a child interp to grab values from the parent. i've found, if i use upvar, and try to get one of those variables, the trace is never triggered.
       i've also tryed using 'global' rather than upvar, and IT doesn't work either. i finally fell back on: return [uplevel #0 set 
       $varname] which DOES trigger the trace, but is in my opinion, a bad way to do it.
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.2.1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "07. Variables"
    10. title initialized to: "trace not working in global, and upvar cases"
    11. type initialized to: "Bug"
  2. Ticket change [c49653f492] (rid 111866) by welch on 2000-10-26 08:10:55:

    1. closedate changed to: "2000-10-26T01:10:55"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"