|
|
NSTextView & NSTextField in a NSTextView programmatically?
|
|
|
|
Junior Member
Join Date: Oct 2000
Location: Germany
Status:
Offline
|
|
Hello,
I was just trying out some stuff in cocoa and was wondering if it was possible to display a NSTextView and/or a NSTextField in a NSView programmatically?
If that is possible can you tell me how to go about it. I have tried for quite some time now!
Best regards,
rudy
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
I don't think I understand what you're asking. You want to add an NSTextView to an NSView? Just use addSubview:.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status:
Offline
|
|
- someRectangle is the frame rectange for your text field in the superview's coordinate system. For example, NSRect someRectangle = NSMakeRect(0.0, 0.0, 100.0, 100.0);.
- mySuperview is the view you want to place your text field into.
Code:
NSTextField *myTextField = [[[NSTextField alloc] initWithFrame: someRectangle] autorelease];
[mySuperview addSubview: myTextField];
|
Geekspiff - generating spiffdiddlee software since before you began paying attention.
|
|
|
|
|
|
|
|
Junior Member
Join Date: Oct 2000
Location: Germany
Status:
Offline
|
|
Thanks alot guys! You're great, I'll try it out immediately!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|