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

From: Marijn (hkBst at gentoo.org)
Date: Thu Oct 20 11:58:08 EDT 2011

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.

> Calling `on-focus' doesn't make an editor request a refresh, so
> the refresh is currently happening only when the caret is blinked
> (which does cause a refresh request).

That explains it.

>> 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?
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?

Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


Posted on the dev mailing list.