
PRO multidraw_event, event

WIDGET_CONTROL, GET_UVALUE = retval, event.id	;use the uservalue to find the
						;event
CASE retval OF
"EXIT":widget_control,event.top,/destroy
  ELSE: MESSAGE, "Received a bad event <" + retval + ">"
ENDCASE

end

PRO multidraw, GROUP = GROUP

base = WIDGET_BASE( $
		TITLE = "multidraw", $
		/COLUMN, $
		XPAD = 20, $
		YPAD = 20, $
		SPACE = 20)

xpdmenu,['"Done"   EXIT'],base
dispbase = WIDGET_BASE(base, $		;there is a row of displays
		/ROW)				;across the bottom

leftbase = WIDGET_BASE(dispbase, $		;on the left is a column for 
		/COLUMN, $			;the first display
		/FRAME)

leftlabel = WIDGET_LABEL(leftbase, $		;this labels the first display
		VALUE = "left")

kneeslice = WIDGET_DRAW(leftbase, $		;the slice draw widget is where
		XSIZE = 256, $			;the slices are drawn.  Its IDL
		YSIZE = 256, $			;window is found and recorded 
		RETAIN = 2)			;below

rightbase = WIDGET_BASE(dispbase, $		;on the right hand side of the
		/COLUMN, $			;display row is a column for 
		/FRAME)				;the rightmost display

rightlabel = WIDGET_LABEL(rightbase, $		;the label for the right
		VALUE = "right")		;display

kneexray = WIDGET_DRAW(rightbase, $		;the X-ray draw widget's IDL
		XSIZE = 256, $			;window is found below as well
		YSIZE = 256, $
		RETAIN = 2)

rrightbase=WIDGET_BASE(dispbase, $
   	/COLUMN, /FRAME)

rrightlabel=WIDGET_LABEL(rrightbase, $
   VALUE="real right")

rrd=WIDGET_DRAW(rrightbase, $
		xsize=256, ysize=256, retain=2)
WIDGET_CONTROL, base, /REALIZE		;register all the widget things
						;with Xwindows

WIDGET_CONTROL, kneexray, GET_VALUE = left	;get the window ids of both 
WIDGET_CONTROL, kneeslice, GET_VALUE = right	;drawing window to allow 
						;switching back and forth

WSET, left					;set the drawing to the X-ray
show3,shift(dist(64),32,32)
wset,right
show3,shift(dist(64),32,32)

XManager, "multidraw", base

FINISH:

END ;========================= procedure kneedemo =============================






