Re: NSTextView without NSScrollView?
Re: NSTextView without NSScrollView?
- Subject: Re: NSTextView without NSScrollView?
- From: Gideon King <email@hidden>
- Date: Sat, 5 May 2001 12:19:07 +0800
Or you can drag on a custom view in IB, and set the type to NSTextView.
G.
On Saturday, May 5, 2001, at 09:21 AM, John Hvrnkvist wrote:
On Friday, May 4, 2001, at 07:56 PM, Dan Wood wrote:
Is there any way in Interface Builder to create an NSTextView *without*
an associated NSScrollView? There seems to be no way to detach it from
the scroll view. (I want to have an NSTextView, not an NSTextField, so
I can populate it with an HTML <a> tag and make use of the textView:
clickedOnLink: atIndex: delegate method so I can respond to a click.)
You can always remove it from the scroll view when the nib has been
loaded.
That is, do something like:
- (void)awakeFromNib
{
NSView* mainView=nil;
textView=[scrollView documentView];
[textView retain];
[textView removeFromSuperview];
// Set the frame of the text view to something reasonable here. I
think the scroll view's frame should be OK.
[textView setFrame:[scrollView frame]];
mainView =[scrollView superview];
[scrollView removeFromSuperview];
[mainView addSubview:textView];
[textView release];
}
Untested code; use at your own risk.
Regards,
John Hornkvist
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev