public inbox for
 help / color / mirror / Atom feed
From: "Left Spin" <>
Subject: rebinding editor keys
Date: Mon, 16 Jul 2001 10:58:00 -0000	[thread overview]
Message-ID: <> (raw)

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

             reply	other threads:[~2001-07-16 10:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-16 10:58 Left Spin [this message]
2001-07-16 11:09 ` Mo DeJong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).