Re: WIDGET_DRAW and TRACKING_EVENTS [message #9479] |
Wed, 02 July 1997 00:00 |
Phil Williams
Messages: 78 Registered: April 1996
|
Member |
|
|
Laurent Cambresy wrote:
>
> Hi,
>
> I don't understand how to use the keyword TRACKING_EVENTS. I need
> an event when the pointer enters in a window define by a WIDGET_DRAW.
> I use BUTTON_EVENTS and MOTION_EVENTS without any problem. The same
> syntax for TRACKING_EVENTS doesn't work.
> I'm looking for an example for this keyword...
>
> Thanks in advance,
>
> Laurent Cambresy
The way I do this is the following:
pro testEvent, event
type = tag_names(event, /structure)
if type eq 'WIDGET_TRACKING' then begin
;process the tracking event
if event.enter eq 1 then $
print, 'You just entered the Draw widget $
else $
print, 'You just left the draw widget'
endif else begin
;process other events here
endelse
end
pro widgetTest
base = widget_base()
draw = widget_draw(base, xsize=20,ysize=20,/tracking)
widget_control, base, /realize
xmanger, "test", base, event_handler = "testEvent"
end
Hope this helps,
Phil
--
/*********************************************************** ********/
Phil Williams, Ph.D.
Research Instructor
Children's Hospital Medical Center "One man gathers what
Imaging Research Center another man spills..."
3333 Burnet Ave. -The Grateful Dead
Cincinnati, OH 45229
email: williams@irc.chmcc.org
URL: http://scuttle.chmcc.org/~williams/
/*********************************************************** ********/
|
|
|