; $Id: lk_xmanager.pro,v 1.3 2006/11/14 19:06:52 kneller Exp $
pro lk_xmanager,name,id,catch=catch,cleanup=cleanup,$
                event_handler=event_handler,$
                event_func=event_func,$     ;THIS IS THE NEW ONE.
                group_leader=group_leader,$
                just_reg=just_reg,$
                no_block=no_block



;print,'USING LK_XMANAGER'
    ;ORIGINAL XMANAGER
    xmanager,name,id,catch=catch,cleanup=cleanup,$
                event_handler=event_handler,$
                group_leader=group_leader,$
                just_reg=just_reg,$
                no_block=no_block


    ;OVERRIDE EVENT HANDLER CHOICE MADE INSIDE xmanager SO THAT
    ;FUNCTIONS AS WELL AS PROCEDURES CAN BE USED.  THIS WILL ALLOW
    ;THE USER TO RETURN EVENTS FROM THEIR ENCAPSULATED OBJECT WIDGETS.
    if n_elements(event_func) eq 1 then begin

        ;CHECK THAT THE USER PASSED A STRING TO THIS METHOD FOR event_func
        type = size(event_func,/type)
        if type eq 7 then begin
            ;APPLY THE EVENT FUNCTION
            widget_control,id,event_func = event_func
        endif
    endif

end;lk_xmanager