X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 18 Jun 2008 06:34 PM by  anon
Out of curiosity, checking for keywords passed to the main program in event handler
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
18 Jun 2008 06:34 PM
    Is there and easy way to check for keyword arguments passed to the main program while in the event handler. For example, I would like to pass the option to debur or not via /debug. In the main program I can use keyword_set(debug), but this is not recognized in the event handler. I can use options such as system variables, but is there an easy way? Can I pass arguments to the event handler for example?

    Deleted User



    New Member


    Posts:
    New Member


    --
    18 Jun 2008 06:34 PM
    This question is answered in the Online Help article "Managing Application State" in the following IDL 7.0 documentation path 'IDL Programmers' Guides > User Interface Programming > Creating Widget Applications > Managing Application State'. There you will learn that you can hove code like the following in your widget creation routine: state = {wdraw:wDraw, wbutton:wButton, some_data:myData, debug_key:debug} widget_control, tlb, SET_UVALUE=statewhich can subsequently be acquired in the event handler with code like the following: widget_control, event.top, GET_UVALUE=state if state.debug eq 1 then ...James Jones
    You are not authorized to post a reply.