[racket] text-field% receiving characters it shouldn't receive

From: Erich Rast (erich at snafu.de)
Date: Wed May 4 06:00:19 EDT 2011

Hi,

I've got a problem with a GUI app in which a text-field% is on top of a
frame% and a list-box% below it. 

1.) When the text-field has the keyboard focus, it receives characters
of menu shortcuts, e.g. if I press ctl-n for new document, the menu
callback is executed correctly but the text-field will contain an "n"
afterwards. How can I prevent this? Is this a bug?

2.) What is the correct way to ensure that up and down arrow keys are
sent to the list-box, even if the text-field has the keyboard focus? 

Right now, I've overriden on-subwindow-char of the parent frame% but I
had to implement the list-box scrolling myself which seems a bit like a
hack to me. Is it possible that I inadvertantly caused problem 1 by
this? But then, how do you "transfer" chars from widget to widget?

Feature request: In the list-box it would be nice to have two methods:

scroll-selection-down [delta 1] 
scroll-selection-up [delta 1]

where the delta is the number of lines to scroll. 


Best,

Erich







Posted on the users mailing list.