public inbox for
 help / color / mirror / Atom feed
* rebinding editor keys
@ 2001-07-16 10:58 Left Spin
  2001-07-16 11:09 ` Mo DeJong
  0 siblings, 1 reply; 2+ messages in thread
From: Left Spin @ 2001-07-16 10:58 UTC (permalink / raw)
  To: sourcenav

I'm new to Tcl/Tk. I'm rebinding keystrokes for a text widget in Source 

I'm trying to bind <Control-R> to a page up script.

At first I tried

proc sn_rc_editor {view text} {

  bind $text <Control-r> {
    set linesperpage [eval %W cget -height]

    %W mark set insert "insert -$linesperpage lines"
    %W see insert

but I found that $linesperpage was not correct after resizing the window. 
Then I tried

proc sn_rc_editor {view text} {

  bind ${text} <Control-r> [bind ${text} <pageup>]

I have to admit I don't understand how this bind syntax works. I found it in 
some of the Source Navigator source code.
I was thinking that maybe I could just map the keystroke to the already 
defined page up functionality.

Thanks for your help.

Get your FREE download of MSN Explorer at

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-07-16 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-16 10:58 rebinding editor keys Left Spin
2001-07-16 11:09 ` Mo DeJong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).