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: Ron Wagner <email@hidden>
- Date: Sun, 15 Jun 2003 18:20:31 -0400
On Friday, June 13, 2003, at 04:08 PM, Fritz Anderson wrote:
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?
You've read-up on the options in the size pane in Interface Builder?
It's trivial to have an NSView keep its position relative to an edge of
the window, regardless of how the window resizes.
OK, I've played with simple examples and re-read about the struts and
springs in Interface Builder. Even got simple examples to stick to the
top left corner of the window. All fine and straight forward as
expected.
Where I can't get it to work is when I stick the view into an
NSScrollView. I guess the documentView being scrolled is sticking to
the origin of the NSClipView inside the NSScrollView? I read in the
Anguish/Buck/Yachtman book about subclassing NSScrollView to add a
zoom popup inside the horizontal scrollbar area, overriding the -tile
method. I am thinking I could do the same, calling the inherited -tile,
then moving the documentView up if it is smaller than the NSClipView.
Does this sound reasonable or am I barking up the wrong tree?
BTW, the original question was about keeping subviews at the top of
their superview, related to using disclosure triangles to
expand/collapse views. I've already coded it to work using the existing
cocoa coordinate system with origin bottom-left. What I am asking now
has to do with being embedded in an NSScrollView, getting the
documentView to stay at the topLeft.
On a side note, does anyone know how to return the background color of
an NSScrollView to its original color of "none"? I set a background
color for debugging purposes, but now can't find a way to set it back
to none short of unpacking the documentView out of the NSScrollView and
re-embedding it.
Thanks,
Ron Wagner
_______________________________________________
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.