Re: Can't set input focus to draw widget [message #35206 is a reply to message #35169] |
Thu, 15 May 2003 10:47  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
James Rioux (jamesriouxctm@hotmail.com) writes:
> 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?
Wasn't this reported as a bug just a couple of weeks ago!?
A couple of brain cells seem to be firing, but I can't tell
if I am remembering something or if the anti-inflamatories
are causing hallucinations again. :-(
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|