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

Home » Public Forums » archive » Re: idl draw widgets
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: idl draw widgets [message #6312] Thu, 06 June 1996 00:00
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Brian J Soher <soher@itsa.ucsf.edu> wrote:
>
> Is there a way to make idl draw widgets generate an event when
> the mouse is in the draw widget canvas, and a keyboard button
> is pressed? EG. to make a box be drawn at the mouse location
> by hitting the 'b' key while the mouse provides the (x,y)
> location?


I'm not sure quite what you're after, but unless you already need all
the buttons on the mouse for other features, I'd just use one of the
buttons to provide this functionality. Use the /BUTTON_EVENTS keyword
in WIDGET_DRAW(). Then, in your event handler, you can use the EVENTS
structure for the X,Y coordinates, to tell you which button was pressed,
etc. (see the online help for WIDGET_DRAW() ).

You could also set /MOTION_EVENTS to enable motion events for the
draw widget, and for each event that is processed, in your event
handler say:

k = get_kbrd(0)

and then draw a box if ( k eq 'B' or k eq 'b' ). But if you don't
need the buttons for other things it makes more sense to use them.

Dave Foster
UCSD Brain Image Analysis Laboratory
foster@bial1.ucsd.edu
[Message index]
 
Read Message
Previous Topic: Re: Question about use?
Next Topic: Re: Targa (TGA) reader

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

Current Time: Wed Oct 08 15:07:37 PDT 2025

Total time taken to generate the page: 0.00356 seconds