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 protected]
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]