Difficulty getting full screen window support in Lion fully working
Difficulty getting full screen window support in Lion fully working
- Subject: Difficulty getting full screen window support in Lion fully working
- From: "Fletcher T. Penney" <email@hidden>
- Date: Fri, 12 Aug 2011 10:29:01 -0400
- Resent-date: Fri, 12 Aug 2011 10:34:03 -0400
- Resent-from: "Fletcher T. Penney" <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: email@hidden
I have a document-based application, and am trying to add Lion support. I have not installed Lion myself yet, wanting to make sure I get this project out the door before possibly complicating things on my development machine during the upgrade.
I was able to get most features (versioning, auto save, restoration, etc) working pretty easily using information from:
http://oleb.net/blog/2011/07/whats-new-for-developers-in-lion-part-1/
When I gained temporary access to a Lion machine for some quick testing, I enabled full screen mode using information there as well. Everything is combined as shown (except for the plist changes described on the above web site):
// Enable Lion Features if appropriate
NSWindow *docWindow = [aController window];
if ([docWindow respondsToSelector:@selector(setRestorable:)])
{
[docWindow setRestorable:YES];
int fakeLionFlag = 1 << 7; // NSWindowCollectionBehaviorFullScreenPrimary
NSWindowCollectionBehavior behavior = [docWindow collectionBehavior];
behavior |= fakeLionFlag;
[docWindow setCollectionBehavior:behavior];
}
(This code is in the windowControllerDidLoadNib: method in my NSDocument subclass.)
When I test this, it allows me to use the button in the upper-right corner of the window to make the current document window full screen. However, when I move the mouse to the right or left side of the screen, the cursor does not change to allow me to adjust the document width. This forces the window to remain at full width, which is a bit awkward for a text editor window. The resizing does work when I test in Safari on that same machine.
My document/window's .xib is built in Xcode 4.0.2, so I do not have the option to enable Autolayout, if that matters. On it's own, the window is easily resizable. It does (optionally) include a ruler for the Window->Scroll View->Text View, again - if that makes a difference.
I haven't been able to find any documentation (official or ortherwise) that really gets into the specifics of how to implement this feature. I had assumed it would be automatic, but apparently not.
Any tips on what to do, pointers towards good resources on this functionality, or anything else?
A secondary question is that I currently use a drawer to display a "table of contents" to the document. The drawer is hidden when the window goes full screen, which I suspected might be the case. Is there a way to display drawers in full screen mode, or will I need to restructure as a second window that gets included in the full screen space? This feature is not as urgent, but is something I will have to look into at some point.
Thanks!!
Fletcher
--
Fletcher T. Penney
email@hidden
_______________________________________________
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