From: Robert Klemme Date: 2004-10-04T19:39:53+09:00 Subject: Re: how to escape variable expansion in a block "Yukihiro Matsumoto" schrieb im Newsbeitrag news:1096884099.590405.15952.nullmailer@x31.priv.netlab.jp... > Hi, > > In message "Re: how to escape variable expansion in a block" > on Mon, 4 Oct 2004 05:33:09 +0900, "Joachim Wuttke" writes: > > |It works, but the introduction of the auxiliary > |variable �this� is not very elegant. Is there another > |way to tell the TkButton constructor that �buttonPressed� > |is a member of the class it was called from ? > > Currently, there's no way to avoid. If TkObject had parent attribute, > it could be: > > | TkButton.new( frame ) { > | text 'press here' > | command proc { parent.buttonPressed } > | } > > Just a possibility. What about TkButton.new( frame ) { text 'press here' command proc { self.buttonPressed } } ? robert