A window that rejects focus
A window that rejects focus
- Subject: A window that rejects focus
- From: John Stiles <email@hidden>
- Date: Tue, 19 Feb 2008 16:24:39 -0800
I am trying to implement a hierarchy of windows—e.g. clicking a button
on window A opens window B, and until window B is closed, window A can
no longer be focused at all. This isn't the same as a modal window
because a hypothetical window C, unrelated to windows A or B, should
still be accessible. It's more like sheets, actually, except that in
this case using a sheet would probably not be a good design.
I thought I could implement this by overriding -canBecomeKeyWindow and
-canBecomeMainWindow and having window A return false, but this actually
doesn't work. Instead, I have a window that rejects keyboard focus and
the title bar never looks "activated," but it can still become
frontmost, and clicking in it still works. It's really quite bizarre;
it's not something that seems even remotely usable, so I'm really
confused as to why you'd actually want to override these methods.
But anyway—is there any way to get a window to refuse clicks and refuse
to become frontmost?
(It seems like sheets have this concept of window-based modality, where
a sheet can cause its parent window(s) to become modal to the sheet
without affecting other windows in the app. There should be a way to get
this same behavior for my own windows!)
_______________________________________________
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