Putting stuff into a tab view programmatically
Putting stuff into a tab view programmatically
- Subject: Putting stuff into a tab view programmatically
- From: Sam Goldman <email@hidden>
- Date: Sun, 28 Oct 2001 16:12:10 -0800
What I am trying to do is have a NSTabView where the user can add a
NSTabViewItem on demand and each added NSTabViewItem will have a NSTextView
inside. The way that I think I have to this is to add a NSTextView
programmatically each time a new NSTabViewItem is added. If there is a
better/easier way then tell me. Otherwise, how would I do this?
So far I think that I am on the right track. I make a new NSTextView with
this:
NSTextView *myTextView = [[NSTextView alloc] init];
I get the view of the NSTabView's first item (there is only one to start)
and place the NSTextView into it with this:
[[[tabView tabViewItemAtIndex:0] view] addSubview:myTextView];
Is that right? When I do that, nothing shows up. I have never tried anything
like this before, and don't really understand what a subview is. Am I going
about this in the right way?
Thanks,
Sam