From: nornagon Date: 2005-05-25T21:37:04+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 > --------------------------------------------------- Hmm. I've been using this for a while and it works quite nicely. However, I've noticed that it prevents you from copying from the text box using Ctrl+C. Is there a way to fix this? -- - nornagon