Re: View system usage with lower left origin
Re: View system usage with lower left origin
- Subject: Re: View system usage with lower left origin
- From: Quentin Mathé <email@hidden>
- Date: Sat, 14 Jun 2003 10:20:51 +0200
Le vendredi, 13 juin 2003, ` 01:35 Europe/Paris, Ron Wagner a icrit :
Hello,
I am new to Cocoa and have a basic question regarding usage of the
view system. I have a window that will contain several similar views
which I want to add disclosure triangle controls to, similar to the
Apple System Profiler application. Since the origin is at the lower
left corner, seems like I can't just set the size of the containing
view to just expose the triangle control and the title. The whole
origin at the bottom left corner instead of the top left corner seems
weird to me since layouts tend to naturally originate from the top and
flow downwards.
So how do seasoned cocoa developers handle things like this? Would you
set the height of the containing view to a size just exposing the
triangle control with title and apply a transformation matrix to the
view to move it down into position? I've seen some example
applications that have their content stick to the lower left corner
when the window is enlarged. How do you get stuff to stick to the top
of the window?
Any other general tips or tricks regarding upside down coordinate
systems would be appreciated. I realize that it is the postscript/pdf
model, but it doesn't seem natural for user interfaces.
The simplest solution is to flip the embedded views coordinates, it is
possible to do it by using a subclassed NSView which implements the
following method :
- (BOOL)isFlipped {
return YES;
}
Then the thing to do is to have the subclassed NSView to be the
embedded views class.
With the flipped views, the coordinates are top left based for these
views, no more bottom left based then it's easier, especially if you
need to resize your embedded views on the fly.
--
Quentin Mathi
email@hidden
_______________________________________________
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.