From: nornagon Date: 2005-05-24T15:40:25+09:00 Subject: Re: Tk read-only text box On 5/24/05, Hidetoshi NAGAI wrote: > From: nornagon > Subject: Tk read-only text box > Date: Tue, 24 May 2005 06:56:06 +0900 > Message-ID: <14d6153305052314567ab0b4d9@mail.gmail.com> > > I need something with the same functionality; I would like the user to > > be able to select the text and scroll through it, but not edit it. > > Also, I need to be able to change its contents dynamically. > > Hmmm.... Probably there are some ways. > One of the ways is "block Key events". > To do that, please use Tk.callback_break. > For example, > --------------------------------------------------- > require 'tk' > t = TkText.new.pack > t.bindtags_unshift(b = TkBindTag.new) > b.bind('Key', proc{ Tk.callback_break }) > > t.insert(:end, "This is a test message.\n"); > > Tk.after(10000){t.insert(:end, "This is another test message.\n")} > > Tk.mainloop > --------------------------------------------------- Interesting. Could you tell me how that works, exactly? Like, what's bindtags_unshift do? What's a BindTag, even? Thanks a lot for your patience. ^_^ -- - nornagon