Re: Cocoa replacement for SetWindowModality
Re: Cocoa replacement for SetWindowModality
- Subject: Re: Cocoa replacement for SetWindowModality
- From: Russ <email@hidden>
- Date: Tue, 2 Dec 2008 10:22:21 -0800 (PST)
I have a dialog that lets you experimentally make changes to the file based on statistical measures. It is modal because when you're messing with it, it is repeatedly undoing the prior changes then making new ones. It needs to keep a fairly tight lock on the situation to avoid creating many large undo records (can be megabytes apiece). But it is extremely handy for users to be able to unlock the modality so they can go examine the results of the changes, then relock to resume normal modal operation. Typically when users see this, they go "Wow! I wish I could do this in some other programs too...." It's a little unusual since you don't need the overall functionality in text editors. It took a little thought to accomplish but is not complicated in Windows or Carbon. This is a cocoa-ization of an existing app's portability layer, so changes to the user-level functionality are unacceptable, and changes to the application's code are undesirable --- I'm just
looking for a SetWindowModality equivalent to put into the cocoa interface layer.
So far, the only possibility I have seen is to override worksWhenModal for all my windows to return a private value (as NSPanel presumably does), and when needed, go adjust the settings for all the OTHER windows to accept input, leaving the modal dialog modal the whole time. But this will only work if worksWhenModal is getting called per-event to verify its status ---- but I see that NSWindow has a worksWhenModal bit in __wFlags, which suggests it is cached, and that this strategy probably won't work.
----- Original Message ----
Sent: Tuesday, December 2, 2008 12:32:24 PM
Subject: Re: Cocoa replacement for SetWindowModality
On Dec 2, 2008, at 7:28 AM, Russ wrote:
> In my UI there's a spot where it's very useful for the user to be able to change a window from modal to modeless for a little while. In Carbon, I used SetWindowModality to do so. How can I do the same in Cocoa? It doesn't look like I can reconfigure a run loop to do this. Thanks.
Perhaps if you'd tell us why you'd want to do this, we might be in a better position to offer good advice.
Thanks,
j o a r
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden