Most elegant way to 'reroute' Text widget events?

  • Thread starter Kenneth McDonald
  • Start date
K

Kenneth McDonald

After a couple of unsuccessful experiments, I'm afraid it's time to
ask the group. What I want to do is to use the text widget for
display, but to have keyboard events processed solely by Ruby. I've so
far been unsuccessful in unbinding any of the text widget's built-in
functionality, and don't want to go in and modify text.tcl, as that
strikes me as highly inelegant. I'm assuming that somehow I need to
(1) unbind the text widget I'm using from all events, and then (2)
bind all key events to (say) the top-level window. Unfortunately, my
attempts at this have met with little success. (None). Could some Tk-
fu master point me in the right direction? (At the moment, I simply
can't get things unbound from the text widget; I thought
text.bindtags([]) might work, but it didn't.)

Many thanks,
Ken
 
H

Hidetoshi NAGAI

From: Kenneth McDonald <[email protected]>
Subject: Most elegant way to 'reroute' Text widget events?
Date: Tue, 2 Sep 2008 11:37:33 +0900
Message-ID: said:
strikes me as highly inelegant. I'm assuming that somehow I need to
(1) unbind the text widget I'm using from all events, and then (2)
bind all key events to (say) the top-level window. Unfortunately, my
attempts at this have met with little success. (None). Could some Tk-
fu master point me in the right direction? (At the moment, I simply
can't get things unbound from the text widget; I thought
text.bindtags([]) might work, but it didn't.)

Probably, the most simple way is
 
K

Kenneth McDonald

Hidetoshi,

Thanks for all your help, it's been great. I would never have figured
out that
one--I'm trying to translate too literally from Tcl.

Ken


From: Kenneth McDonald <[email protected]>
Subject: Most elegant way to 'reroute' Text widget events?
Date: Tue, 2 Sep 2008 11:37:33 +0900
Message-ID: said:
strikes me as highly inelegant. I'm assuming that somehow I need to
(1) unbind the text widget I'm using from all events, and then (2)
bind all key events to (say) the top-level window. Unfortunately, my
attempts at this have met with little success. (None). Could some Tk-
fu master point me in the right direction? (At the moment, I simply
can't get things unbound from the text widget; I thought
text.bindtags([]) might work, but it didn't.)

Probably, the most simple way is
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top