From: Hidetoshi NAGAI Date: 2005-07-18T08:00:32+09:00 Subject: Re: TkVarible question From: Joe Van Dyk Subject: Re: TkVarible question Date: Sat, 16 Jul 2005 04:51:08 +0900 Message-ID: > Don't ask me why it is, but: > > #label1 = TkLabel.new(root) do > #textvariable @tkvar > #pack > #end > label1 = TkLabel.new(root, :textvariable => @tkvar).pack > > That works. The block given to 'new' method is passed to 'instance_eval' method. That is, @tkvar in the block is not an instance variable of the Tktest object but of the label widget. And then, because @tkvar is nil, the textvariable option value of the widget is set to an empty string. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)