Resizing window to fit drawer
Resizing window to fit drawer
- Subject: Resizing window to fit drawer
- From: Jan Van Tol <email@hidden>
- Date: Tue, 11 Mar 2003 21:29:17 -0600
List,
I'm trying to make my main window resize to fit a drawer on the screen,
much like Camino does. To this end, I've written the following code:
NSRect drawerRect = [[[subscriptionsController drawer] contentView]
frame];
drawerRect.origin.x = drawerRect.origin.x + [[[subscriptionsController
drawer] contentView] frame].size.width;
drawerRect = [[[NSApp mainWindow] contentView] convertRect:drawerRect
fromView:[drawer contentView]];
NSPoint drawerPoint = NSMakePoint(drawerRect.origin.x,
drawerRect.origin.y);
NSLog(@"drawerPoint: %f", [[NSApp mainWindow]
convertBaseToScreen:drawerPoint].x);
NSLog(@"mainScreen: %f", [[NSScreen mainScreen]
visibleFrame].size.width);
No doubt I'm making a grievous mistake somewhere, but I can't see it.
What I'm hoping for it to do, is to log the width of the screen (which
works fine), and log the right edge of the drawer, in the screens
coordinate system. Instead I get 1121 for the screen (correct), and
218 for drawerPoint. So what am I doing wrong? Also, am I going about
this correctly, or is there some other way?
Thanks in advance,
-Jan Van Tol
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.