From: Jeppe Jakobsen Date: 2006-04-02T01:29:04+09:00 Subject: Re: Questions about Tk - Newbie ------=_Part_12290_16822680.1143908941279 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline It's for a sort of calculater that I'm writing (It's supposed to make my math and physics exams less painful ), so I need to be able to edit some output, shown in the TkText field, before I process the output further. Thank very much you for the example, I think it was just what I needed to make it work :) 2006/4/1, Hidetoshi NAGAI : > > 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 =3D TkVariable.new > > TkLabel.new(:textvariable=3D>v, :relief=3D>:ridge).pack > TkButton.new(:text=3D>'add str', :command=3D>proc{v.value +=3D 'str'}).pa= ck > t =3D TkText.new.pack > > v.trace('w', proc{t.value =3D v.value}) > t.bind('KeyPress', proc{v.value =3D t.value}) > > Tk.mainloop > ----------------------------------------------------------- > -- > Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) > > -- "winners never quit, quitters never win" ------=_Part_12290_16822680.1143908941279--