Dear Tuyen,
Most likely, you want something like the following (see below). Adding additional namespaces makes things more complicated. Creating procs from a constructor is as well a rather unusual construction, normally you want to define methods accessing the instance variables...
best regards -gustaf neumann
=================== Class create MatlabInterface -parameter {iss} MatlabInterface instproc ok {} { my instvar iss tk_messageBox -type ok -icon info -title "MicWatch" -message $iss }
MatlabInterface i1 -iss Hello? i1 ok ===================
Am 16.03.11 13:40, schrieb Tuyen Hoang:
Can anyone tell me how to refer an instvar from within a namespace defined inside a class constructor? With my attempt below the $iss in the tk_messageBox line is undefined.
Class create MatlabInterface
MatlabInterface instproc init {} { my instvar iss namespace eval MicWatch { proc add {} { tk_messageBox -type ok -icon info -title "MicWatch" -message "$iss" } } }
I’m new to Tcl, let alone XOTcl, and don’t know how to search the posts in the mailing list so forgive me if the question has been asked before.
Regards,
Tuyen
Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl