Sujet : A TclOO question De : hgiese (at) *nospam* ratiosoft.com (Helmut Giese) Groupes :comp.lang.tcl Date : 17. May 2025, 21:57:56 Autres entêtes Organisation : ratiosoft Message-ID :<marh2ktom6u4bkkdcd5nbsef9lnvqi02gq@4ax.com> User-Agent : Forte Free Agent 1.93/32.576 English (American)
Hello out there, say I have a class and 2 instances like so
oo::class create MyClass { constructor {someVal} { my variable myVar set myVar $someVal } method get {} { my variable myVar return $myVar } method set {val} { my variable myVar set myVar $val } }
MyClass create obj1 33 MyClass create obj2 99
How can I set a trace on 'myVar' of 'obj2'? I found an example on the doc of the 'my' command but it sets a trace on a global variable during which an object is invoked - which doesn't fit my situation Any help will be greatly appreciated Helmut