End modal problems
End modal problems
- Subject: End modal problems
- From: email@hidden (mikevannorsdel)
- Date: Mon, 17 Dec 2001 02:07:22 -0700
I'm trying to implement modal windows that automatically close after some
delay. I create the timer and add it to the current run loop's modal mode,
then I run the modal session. The timer fires as expected, but after that
is when the problem occurs. The method executed by the timer uses [NSApp
stopModalWithCode:code] to end the modal session. However, the session is
not ended then. The session will not end until the modal window receives an
event, such as a mouse click. I've tried a performClick: with the default
button, but that doesn't work either. I've considered using NSApp's
sendEvent: to simulate a click in the modal window, but haven't tried yet.
Is there a better way? Perhaps changing the run loop's mode in the timer's
method?