View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] XOTcl-next

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Fri, 04 Jan 2008 13:19:43 +0100

Murr, Florian schrieb:
> Dear XOTcl-guys!
> The script below might illustrate another XOTcl bug.
>

Dear Florian,

That's not a bug. [info level 0] does not return the name of the method
in all situations, since "info level" is not xotcl-aware and is not touched
by the xotcl implementation. In situations, where - from the Tcl point
of view - the cmd "next" calls a method, "info level 0" returns "next".
There is nothing wrong about this.
> X instproc fun {w} { puts "[self] [info level 0]"; button $w.b;
> return $w.b }
>
In cases, where you want to output the name of the active method, use
XOTcl's callstack introspection with - in this case - "self proc". Change
your code as follows to obtain the method name in the outpt.

X instproc fun {w} {puts "[self] [self proc]"; button $w.b;
return $w.b }

best regards
-gustaf neumann