From: Hidetoshi NAGAI Date: 2005-05-25T23:21:52+09:00 Subject: Re: Tk read-only text box From: nornagon Subject: Re: Tk read-only text box Date: Wed, 25 May 2005 21:37:04 +0900 Message-ID: <14d6153305052505371034227a@mail.gmail.com> > 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? Here is an example. ---------------------------------------------------------------- require 'tk' t = TkText.new.pack t.bindtags_unshift(b = TkBindTag.new) b.bind('Key', proc{ Tk.callback_break }) b.bind('Control-KeyPress-w', proc{ Tk.callback_continue }) # continue to the next bindtag b.bind('Control-KeyPress-y', proc{}) b.bind('Control-KeyPress-c', proc{t.insert(:end, "Press Ctrl-C !!\n")}) b.bind('Control-Alt-KeyPress-c', proc{exit}) t.insert(:end, "This is a test message.\n"); Tk.after(10000){t.insert(:end, "This is another test message.\n")} Tk.mainloop ---------------------------------------------------------------- For one event, only one binding is called on each bindtag. That is most detailed one which matched to the event. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)