Answer - Image not being retained [message #1925] |
Tue, 05 April 1994 21:20 |
dean
Messages: 55 Registered: March 1993
|
Member |
|
|
I received several responses about my problem with retaining the image
in WIDGET_DRAW with scoll bars after implementing CURSOR, even after using
RETAIN=2. I have been told that WIDGET_DRAW and CURSOR are not designed to
work together.
The solution is very simple - after it was pointed out to me. By removing
CURSOR and using WIDGET_DRAW's BUTTON_EVENTS and MOTION_EVENTS, the image
is retained while scolling.
If you set up WIDGET_DRAW to look like this:
.
.
.
draw = Widget_Draw(drawbase, $
/BUTTON_EVENTS, $ ;Generate mouse buttons events
/MOTION_EVENTS, $ ;Generate mouse motion events
/FRAME, $ ;Frame drawing area
RETAIN = 2, $ ;Make sure IDL provides backing store.
XSIZE = x_size, $ ;The x size of display area
YSIZE = y_size) ;The y size of display area
.
.
.
You can do this later on without CURSOR.
.
.
.
pxvnt = widget_event(draw)
WHILE (pxvnt.press NE 4 ) DO BEGIN
pxvnt = widget_event(draw)
x = pxvnt.x
y = pxvnt.y
.
.
.
Thanks everybody for your help.
Kelly Dean
CSU/CIRA
|
|
|