From: Hidetoshi NAGAI Date: 2006-04-02T00:05:48+09:00 Subject: Re: Questions about Tk - Newbie From: "Jeppe Jakobsen" Subject: Re: Questions about Tk - Newbie Date: Sat, 1 Apr 2006 22:59:01 +0900 Message-ID: <99b4ad3b0604010558n30ce10c2pd4ae3b5986cf0b6a@mail.gmail.com> > Ok, but what is then common to do when you have a variable pointing to a > string with 1-10 lines of text and you want the string displayed in an > editable field? Hmm... I don't know why you need such realtime reflection. I think you may have better solution for your problem. However, if you really need it, for example, ----------------------------------------------------------- requrie 'tk' v = TkVariable.new TkLabel.new(:textvariable=>v, :relief=>:ridge).pack TkButton.new(:text=>'add str', :command=>proc{v.value += 'str'}).pack t = TkText.new.pack v.trace('w', proc{t.value = v.value}) t.bind('KeyPress', proc{v.value = t.value}) Tk.mainloop ----------------------------------------------------------- -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)