document limitations of on-subwindow-event' and on-subwindow-char'

Merge to 5.1
This commit is contained in:
Matthew Flatt 2011-02-05 16:48:04 -07:00
parent 3c6652b83c
commit e2a0fd02ef
2 changed files with 20 additions and 3 deletions

View File

@ -374,6 +374,14 @@ Called when this window or a child window receives a keyboard event.
@method[window<%> on-subwindow-char] method returns @scheme[#f], the event is passed on to the receiver's
normal key-handling mechanism.
The @scheme[event] argument is the event that was generated for the
@scheme[receiver] window.
The atomicity limitation @method[window<%> on-subwindow-event] applies
to @method[window<%> on-subwindow-char] as well. That is, an insufficiently cooperative
@method[window<%> on-subwindow-char] method can effectively disable
a control's handling of key events, even when it returns @racket[#f]
BEWARE: The default
@xmethod[frame% on-subwindow-char] and
@xmethod[dialog% on-subwindow-char] methods consume certain keyboard events (e.g., arrow keys, Enter) used
@ -382,9 +390,6 @@ BEWARE: The default
reach the ``receiver'' child unless the default frame or dialog
method is overridden.
The @scheme[event] argument is the event that was generated for the
@scheme[receiver] window.
}
@methimpl{
@ -409,6 +414,13 @@ Called when this window or a child window receives a mouse event.
The @scheme[event] argument is the event that was generated for the
@scheme[receiver] window.
If the @method[window<%> on-subwindow-event] method chain does not complete
atomically (i.e., without requiring other threads to run) or does not complete
fast enough, then the corresponding event may not be delivered to a target
control, such as a button. In other words, an insufficiently cooperative
@method[window<%> on-subwindow-event] method can effectively disable a
control's handling of mouse events, even when it returns @racket[#f].
}
@methimpl{

View File

@ -155,6 +155,11 @@ callbacks or outside of an even callback. The continuation barrier and
jump-defeating `dynamic-wind' that formerly guarded callbacks has been
removed.
The `on-subwindow-char' and `on-subwindow-event' methods for controls
are somewhat more restructed in the actions they can take without
disabling the control's handling of key and mouse events. See the
documentation for more information.
Registry Functions
-----------------