comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Widget Button trigger through keypress?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Widget Button trigger through keypress? [message #19414] Tue, 14 March 2000 00:00 Go to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Oliver Smith wrote:
>
> In order to satisfy users of the previous version of the software I'm
> developing, I'd like to be able to trigger a widget button by pressing a
> designated key on the keyboard, whilst retaining the option to press buttons
> with the mouse.
>
> I know the get_kbrd function can be used to read a character from the
> keyboard, which could be tested in a case statement and then the appropriate
> procedure called; but this seems rather long-winded. Is there a simple way
> to associate a keyboard button with a widget button?
>


Get_kbrd only works at the terminal (command input line), not within widgets, so
that won't work (unless you tell your user to click back there and enter text,
plus have a timer event loop running). What I usually do is have a graphical
widget button which changes it's graphic depending on whether it is selected or
not, and use a hidden text widget to capture relevant keyboard events, which
then sets the graphics as if it had been pushed (I often use B&W bitmaps and XOR
them with 255b to invert them -- you could obviously also use color bmp files).
David refers you to the page which preserves this hidden text widget hackery for
all time.

JD

P.S. has anyone found out how to set color bitmaps into button values without
keeping them all in separate files?

--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
[Message index]
 
Read Message
Read Message
Previous Topic: Help: Weighted quadratic fitting under IDL?
Next Topic: Widget Button trigger through keypress?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 01:55:35 PDT 2025

Total time taken to generate the page: 1.03922 seconds