[racket-dev] while resizing drawing into a canvas is off

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Oct 20 12:12:21 EDT 2011

At Thu, 20 Oct 2011 17:58:08 +0200, Marijn wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 10/20/11 14:53, Matthew Flatt wrote:
> > At Thu, 20 Oct 2011 11:16:59 +0200, Marijn wrote:
> >> Could you perhaps comment on the slowness of the cursor appearing
> >> in a clicked cell? It seems to have something to do with the
> >> timer frequency, because if I decrease the frequency the first
> >> time that the cursor appears is also sooner after clicking in a
> >> cell.
> > 
> > I think you need to add `(send grid refresh)' to the admin's 
> > `set-focus' method.
> 
> It's funny that you mention this `set-focus' method, because I can't
> find it in the docs, although my code seems to think it's a canvas%
> method (oops?). I hope my confusion isn't contagious. ;P
> Calling `refresh' of either the display or the editor in the admin's
> on-focus works beautifully though, thanks.

Sorry --- I meant the `on-focus' method in your admin class.

> >> Another thing. How do you enable simple select/copy/cut/paste
> >> behavior with standard key-bindings in an editor?
> > 
> > Apply `(current-text-keymap-initializer)' to the editor.
> 
> I'm kinda struggling with this one. What I came up with is:
> 
> (define default-keymap (new keymap%))
> ((current-text-keymap-initializer) default-keymap)
> (add-text-keymap-functions default-keymap)
> 
> and then I do (send editor set-keymap default-keymap) for each editor.
> Is that what you meant?

Yes, though I forgot exactly how the parameter value works.

> This makes some emacs-like bindings work (C-a and C-e go to beginning
> and end of line, C-y -> yank). Is there a way to get the more familiar
> {C-a -> select-all, C-v -> copy-selection, etc.} bindings?

Use `add-editor-keymap-functions' in addition to
`add-text-keymap-functions'.



Posted on the dev mailing list.