;+
; Generic cleanup for writing object widget programs. XMANAGER will not
; allow methods to be called via the CLEANUP keyword. To get around this:
; <ol>
; <li>Specify CLEANUP='mg_object_cleanup' as a keyword to
; XMANAGER</li>
; <li>Put the object widget's reference in the TLB's UVALUE.</li>
; <li>Write a cleanupWidgets method in your object widget.</li>
; </ol>
;
; @param tlb {in}{required}{type=structure} top-level base widget ID
;-
pro mg_object_cleanup, tlb
compile_opt strictarr
widget_control, tlb, get_uvalue=owidget
owidget->cleanupWidgets, tlb
end