[plt-scheme] Mred - How to know which canvas is active?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Nov 4 17:55:35 EST 2006

Does the combination of `get-top-level-edit-target-window'
and the `get-edit-target-window' method (of a top-level-window)
work as expected?

I think `get-active-canvas' wouldn't work, because each editor has its
own canvas, and so both canvas would be "active".

Depending on the platform and the relevant callback, I can see why
`has-focus?' might not work. Menu items on X, for example, move the
focus to the menu temporarily.

Finally, clicking a button might move the focus to the button (on some
platforms). In that case, the only solution that comes to mind is to
override the `on-set-focus' method of the canvases, and explicitly
track which one most recently had the focus.

Matthew

At Sat,  4 Nov 2006 22:48:32 +0100, jack4746 at anonmail.de wrote:
> Hi all,
> 
> I'm using Mred and can't get the active canvas which has keyboard 
> focus on.
> My interface is like DrScheme's one: i've got a frame containing 2 
> editor canvases.
> 
> I tried: (has-focus?) which doesn't make it neither does (get-
> active-canvas).
> 
> Section 2.3 from manual "Mouse and Keyboard Events" is talking 
> about (on-subwindow-event)
> and (on-subwindow-char), but i didn't figure out how to make them 
> work and i'm not sure
> that's the one to use.
> 
> Any help please?
> Thks in advance.
> 
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.