Hi Gerard,
You should be able to use widget_control to get the value of the window, the you can use the erase method (
http://www.exelisvis.com/docs/Erase_M...) to clear the widget window. Here is a small example widget I created which illustrates this:
pro widget_window_clear_event, event
compile_opt idl2
;get th einformation stored in the base widget
WIDGET_CONTROL, event.top, GET_UVALUE = info
;get the name of the button beign pressed
WIDGET_CONTROL, event.id, GET_VALUE = name
case name of
'Clear':(info.owin).erase
'Re-Draw':p = plot(/test, current = info.owin)
'Close':widget_control, event.top, /destroy
else:
endcase
end
pro widget_window_clear
compile_opt idl2
ireset, /no_prompt
;widget window dimensions
window_dims = [600,600]
;create starting widgets
wBase = widget_base(/column)
wDraw = widget_window(wBase,$
xsize=window_dims[0],$
ysize=window_dims[1])
widget_control, wBase, /realize
wButtonNext = widget_button(wBase,value='Clear')
wButtonNext2 = widget_button(wBase,value='Re-Draw')
wButtonNext3 = widget_button(wBase, value='Close')
; Retrieve the newly-created Window object.
widget_control, wDraw, get_value=oWin
;make sample plot
p = plot(/test, current = oWin)
;clear the window of the second image that gets displayed
info = {wBase: wBase,$
wDraw: wDraw,$
oWin: oWin}
widget_control, wBase, set_uvalue=info
xmanager, 'widget_window_clear', wBase
end