My application runs a simulation model and displays results on a window during the simulation run. Consequently, I need Carbon to handle the HIViewSetNeedsDisplay() periodically while the simulation is running.
I tried attaching the model simulation to a menu command. The model simulation is called in the DoCommand loop. The problem is, the application handles HIViewSetNeedsDisplay() AFTER the DoCommand loop is finished. Consequently, only the very last graphic is displayed and nothing before.
To get around this, I tried to create a custom event with the application as a target. I defined an event class ID and kind. The simulation model is called in the application handler for this event. I wanted it so that if the user selected the menu item to run the model, I would then call CreateEvent() to send the simulation event to the application. This seems simple enough - but the call to CreateEvent() in the DoCommand loop results in a segmentation fault (SIGSEGV).
This was so simple to handle in QuickDraw - I periodically called a graphics routine in my simulation code. How can I handle this with Carbon events?
Thanks, Meg
I tried attaching the model simulation to a menu command. The model simulation is called in the DoCommand loop. The problem is, the application handles HIViewSetNeedsDisplay() AFTER the DoCommand loop is finished. Consequently, only the very last graphic is displayed and nothing before.
To get around this, I tried to create a custom event with the application as a target. I defined an event class ID and kind. The simulation model is called in the application handler for this event. I wanted it so that if the user selected the menu item to run the model, I would then call CreateEvent() to send the simulation event to the application. This seems simple enough - but the call to CreateEvent() in the DoCommand loop results in a segmentation fault (SIGSEGV).
This was so simple to handle in QuickDraw - I periodically called a graphics routine in my simulation code. How can I handle this with Carbon events?
Thanks, Meg