Re: Subviews in IB
Re: Subviews in IB
- Subject: Re: Subviews in IB
- From: Quentin Mathé <email@hidden>
- Date: Wed, 14 May 2003 03:05:25 +0200
Le mardi, 13 mai 2003, ` 16:42 Europe/Paris, Steve Roy a icrit :
email@hidden (Quentin Mathi) wrote:
You need to flip the document view coordinates in the scroll view, and
I think you should create a separate custom view in the instance panel
of Interface Builder (you can edit the custom view instance by
double-clicking it), then connect the document view outlet of the
scroll view to it and that's it, just run to see what it looks.
Hum, I'm having trouble doing what you describe. As you mention I
discovered
that I can make a custom view in the Instances tab by dragging
CustomView to it,
that's great.
Now how do I create a scroll view in the window? There are no scroll
view widget
in the floating palette. I tried using an NSTextView but I don't see a
document
outlet for it.
Sorry, I should have explained the solution in the a more detailed
fashion. Here it is :
- drag a custom view in the instance panel, edit it in order to have it
the wanted look
- drag a custom view in your window, select it, go to the custom class
panel in the inspector and choose NSClipView
- package the NSClipView inside your window in a NSScrollView
- double-click the NSScrollView to have the NSClipView selected
- connect the outlet documentView of the NSClipView to the custom view
instance
- subclass NSView in the classes panel, give it the name FlippedView
- in the instances panel, select your custom view, and set the class to
FlippedView in the custom classes panel of the inspector
- create the FlippedView files to have them in Project Builder
- add the following code in the FlippedView.m :
- (BOOL)isFlipped {
return YES;
}
- let's compile and let's run
It should be ok if I'm correct on the flip problem.
Quentin.
--
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.