Re: Bounds questions
Re: Bounds questions
- Subject: Re: Bounds questions
- From: Shawn Erickson <email@hidden>
- Date: Mon, 13 Nov 2006 07:58:06 -0800
I personally cannot follow the issue you are hitting... The numbers
you outlining make little sense given what you state is happening. It
may be best if you provide some example code and more information
about your application.
Important note for the future... views live in local coordinates
which are defined in points while windows and the screen live in a
coordinate space defined in pixels. So you must use the provided API
to convert between those two coordinate spaces. (see -[NSView
convertPoint:fromView:] and friends, -[NSWindow convertScreenToBase:]
and friends, etc.).
Some questions that come to mind...
1) Are you playing around with resolution scaling (via Quartz Debug,
aka resolution independent displays)?
2) You say you have a view that you set bounds on but views live in
windows... so how do you size your window and what type of window is it?
3) Are you attempting to cover the whole display? Did you capture the
display or are otherwise hiding the dock and menu bar?
4) Is the view you are sizing the content view of the window or some
subview? Can you outline your view hierarchy?
As a guess try something like the following...
NSRect screenFrame = [[window screen] frame];
// assuming your content view and subviews are set to autoresize
// then all you should need to do is the following...
[window setFrame:screenFrame display:YES];
... if not using auto resizing views then you may have to utilize
things like -[NSWindow contentRectForFrameRect:] (and the ones I
outlined in my second paragraph) to calculate what you need.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden