Can't set input focus to draw widget [message #35207] |
Thu, 15 May 2003 10:39 |
jamesriouxctm
Messages: 2 Registered: June 2002
|
Junior Member |
|
|
Hello all,
I'm trying to use a draw widget to capture keyboard events in IDL 5.6
for Macintosh OS X. The code I have written works fine on a PC but
when I move it over to the Macintosh I can't get the draw widget to
receive input focus programmatically, even though a text widget on the
same base can get focus.
Specifically, the follow piece of code works properly:
WIDGET_CONTROL, theTextWidget, /INPUT_FOCUS
but this piece of code does nothing at all:
WIDGET_CONTROL, theDrawWidget, /INPUT_FOCUS
The draw widget itself is defined as follows:
WIDGET_DRAW(base, XSIZE=512, YSIZE=512, BUTTON_EVENTS=1,
KEYBOARD_EVENTS=1, RETAIN=2)
so it should be receiving input focus, and indeed, it is on a PC.
I can give the draw widget focus by hitting Tab repeatedly, of course,
but I'd rather not make the user Tab through all of the controls on
the screen every time they want to use the keyboard for something.
I am aware of JD's hidden text widget hack, but since I'd like to
catch arrow and control keys, I don't believe that will work the way I
want it to.
Any suggestions or comments? Does Mac OS X not support keyboard input
focus for draw widgets?
James Rioux, CTM
UNB MRI Research Centre
jamesriouxctm@hotmail.com
|
|
|