Re: How to get windows id or title by clicking on it [message #66891 is a reply to message #66890] |
Thu, 18 June 2009 19:53   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jeanphi62 writes:
> I have to link the event tlb_kill_request_events with the function
> close_window.pro and the event kbrd_focus_events with the function
> test_window.pro (this function gives me the number of the window) so I
> tried :
>
> tlb = widget_base(title="mywindow", MBAR=mbar, /col, $
> /tlb_kill_request_events, event_pro=close_window, $
> /kbrd_focus_events, event_pro='test_window')
>
> but the software crashes.
No, no. You can only have one event handler for a widget.
When you get into that event handler, you can decide if the
event is a kill request or a keyboard focus event:
thisEventName = Tag_Names(event)
CASE thisEventName OF
'WIDGET_KILL_REQUEST': BEGIN....
'WIDGET_KBRD_FOCUS': BEGIN...
ELSE: Print, 'Yikes. Do not have a clue!!'
ENDCASE
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|