FROM : Manfred Schwind
DATE : Wed Apr 30 18:48:24 2008
> You probably shouldn't be putting up a modal dialog from within the
> menu-tracking runloop mode. You can use -
> performSelector:withObject:afterDelay:inModes: to defer the call
> that opens the modal dialog; use a delay of 0.0 but a modes array
> that includes only the default runloop mode.
Thanks for all the answers.
cancelTracking did not work; whyever. I called it recursively for
every NSMenu in the mainMenu. The hanging menu does not close.
The suggested performSelector:withObject:afterDelay:inModes: works
perfectly; the opening of the dialog will be delayed until the menu
closes. Thank you!
(The only problem is, that I have some cross-platform code that
requests the platform specific GUI code to open the dialog and not
return until that dialog closes. Now, by adding the performSelector,
it's no longer synchronous. So I have to change the requirements of
the cross-platform code to be also asynchronous with some callback
once the dialog closes etc.; but it's no problem in this case.)
Regards,
Mani
--
http://www.mani.de
iVolume - Loudness adjustment for iTunes.
LittleSecrets - The encrypted notepad.
DATE : Wed Apr 30 18:48:24 2008
> You probably shouldn't be putting up a modal dialog from within the
> menu-tracking runloop mode. You can use -
> performSelector:withObject:afterDelay:inModes: to defer the call
> that opens the modal dialog; use a delay of 0.0 but a modes array
> that includes only the default runloop mode.
Thanks for all the answers.
cancelTracking did not work; whyever. I called it recursively for
every NSMenu in the mainMenu. The hanging menu does not close.
The suggested performSelector:withObject:afterDelay:inModes: works
perfectly; the opening of the dialog will be delayed until the menu
closes. Thank you!
(The only problem is, that I have some cross-platform code that
requests the platform specific GUI code to open the dialog and not
return until that dialog closes. Now, by adding the performSelector,
it's no longer synchronous. So I have to change the requirements of
the cross-platform code to be also asynchronous with some callback
once the dialog closes etc.; but it's no problem in this case.)
Regards,
Mani
--
http://www.mani.de
iVolume - Loudness adjustment for iTunes.
LittleSecrets - The encrypted notepad.
| Related mails | Author | Date |
|---|---|---|
| Manfred Schwind | Apr 29, 23:12 | |
| Graham Cox | Apr 30, 00:56 | |
| John Stiles | Apr 30, 01:17 | |
| Jens Alfke | Apr 30, 02:30 | |
| Manfred Schwind | Apr 30, 18:48 | |
| John Stiles | Apr 30, 19:05 |






Cocoa mail archive

