When the user hits escape at the prompt for a point, the DynDraw function ends and returns nil to the calling function. At this point the top level program should exit because the user canceled the command. If the user hits enter or space bar at the prompt to accept a default value, the DynDraw function exits and returns nil to the calling function. Is there a way to differentiate between the two?
Could you make the DynDraw function accept a default value as a parameter, so if the user hits Enter or Space at the prompt, the DynDraw function will return the default value and if the user hits Escape to cancel the function, the DynDraw function exits and returns nil?
I have a callback function which when given a point, draws information to the screen. When the callback function receives a string as an option keyword, much like you example, the user is asked to enter values for the input instead of picking a point on screen. At this point the callback function returns nil so the DynDraw function will exit. I have multiple options for the user to enter data that will end the DynDraw loop. I need to be able to differentiate between their outputs.
If the call-back function returns nil, the DynDraw function should return the last value of the call-back functions parameter, so the main calling function can determine which option keyword ended the DynDraw loop.
Also, what do you think would be causing my use of the DynDraw function to not end when my call-back function returns nil?
I am using input flags 2 32 64.
Thanks in advance,
Zoltan