pro unexpected_event, event, destroy=destroy @compile_opt.pro ; On error, return to caller ;+ ; NAME: ; unexpected_event ; PURPOSE: ; Used to process unexpected events in widgets (i.e. events which are ; ignored by the event handler). ; CATEGORY: ; CALLING SEQUENCE: ; unexpected_event, event [,/destroy] ; INPUTS: ; event array[1]; type: structure ; the event structure passed to the event handler ; OPTIONAL INPUT PARAMETERS: ; /destroy if set, the event structure is destroyed (i.e. the scalar ; value 0L is returned in the input argument 'event' ; OUTPUTS: ; event if /destroy is set then event=0L is returned; ; if /destroy NOT set the input event structure is not modified ; CALLSE; ; InitVar ; PROCEDURE: ; The name of the structure is displayed, with a list of all structure fields ; MODIFICATION HISTORY: ; JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- InitVar, destroy, /key help, calls=calls print, calls[1] message, /info, tag_names(event, /structure_name) tags = tag_names(event) for i=0,n_elements(tags)-1 do print, format='(1X,A20,A,I10)', tags[i], ' = ', event.(i) if destroy then event = 0L return & end