Re: Multiple Views in a NSScrollView
Re: Multiple Views in a NSScrollView
- Subject: Re: Multiple Views in a NSScrollView
- From: Robert Spychala <email@hidden>
- Date: Wed, 28 Dec 2005 14:41:23 -0500
Cool, thanks for the suggestion.. "Make subviews of Scroll view" in
IB and indeed the code is simpler.
Now when the NSTextView gets too large for the NSScrollView it
doesn't properly draw the scrollers. Also there are same redrawing
issues where when i delete text from the NSTextView after it has
expanded it doesn't redraw accordingly until i resize the parentView
of my CustomView by dragging a NSSplitView for example...
my minimal code in initWithFrame:
NSRect textRect = NSMakeRect(10, 10, 150, 50);
NSTextView* textView = [[NSTextView alloc] initWithFrame:
textRect];
[textView setBackgroundColor: [NSColor greenColor]];
//[textView setAutoresizingMask:NSViewMinYMargin];
[textView setVerticallyResizable:YES];
[textView setHorizontallyResizable:NO];
[[textView textContainer] setContainerSize:NSMakeSize
(150,FLT_MAX)];
[self addSubview: textView];
any thoughts would be appreciated...
r.s.
On Dec 27, 2005, at 4:03 PM, Philip Dow wrote:
I think it would be a generally better idea and may solve your
problem along the way to simply create a custom NSView and dump
your individual views into that. Then set that custom NSView as the
document view of your regular old NSScrollView.
In the meantime, check the autoresizing and positioning settings on
your text view. If you're created the text view in code, you'll
need to set this up manually.
-Phil
On Dec 27, 2005, at 8:28 PM, Robert Spychala wrote:
Hi,
I'm trying to place a couple of NSImageView, a couple NSTextFields
(red and blue backgrounds) and 1 NSTextView (green background) in
a custom NSScrollView subclass.
I override initWithFrame and create my Views inside. Everything
shows up in my CustomView in the application as they should and
are resized properly except for the NSTextView. Unfortunately the
NSTextView draws itself over the other views.
I was wondering if there is some source code out there that does
this that i could learn from... I need a simple view that contains
an NSTextField and a NSTextView and that is scrolled based on how
much text is in the NSTextView.
My class in question can be found at: http://tastesgood.org/media/
UIEntryDocumentView.m and a screenshot of the result at: http://
tastesgood.org/media/UIEntryDocumentView.png
thanks,
r.S.
http://tastesgood.org/
_______________________________________________
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40visiscience.com
This email sent to email@hidden
Robert Spychala
Voice: 1-718-218-8929
Email: email@hidden
Fax: 1-919-493-3299
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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