subview within NSView?
subview within NSView?
- Subject: subview within NSView?
- From: Alex Reynolds <email@hidden>
- Date: Thu, 30 Mar 2006 01:30:57 -0500
I have a NSWindow (cinoControllerWindow) with a NSView
(cinoControllerWindowView) inside.
I subclassed NSView (CinoDisplayController) and created some
NSPopUpButtons, NSTextFields, and an NSButton inside.
I instantiated this subclass from within CinoControllerWindow:
- (void) awakeFromNib
{
cinoDisplayControllerView=[[CinoDisplayController alloc] init];
...
[cinoControllerWindow makeKeyAndOrderFront:nil];
}
I have code to deallocate this object:
- (void) dealloc
{
...
[cinoDisplayControllerView release];
[super dealloc];
}
In my cinoControllerWindow, I have a button that, when I click on it,
I can change the cinoControllerWindow's title.
What I would like to do is add code that inserts the
cinoDisplayControllerView NSView object as a subview of
cinoControllerWindowView.
I have tried the following:
...
[cinoControllerWindowView addSubview:cinoDisplayControllerView];
...
which is triggered when this particular button is pressed.
However, this does not insert the NSPopUpButton etc. objects within
cinoControllerWindowView.
What am I doing wrong and is there example code or more complete
documentation on subviews within a NSView, other than:
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSView.html#//apple_ref/occ/instm/
NSView/addSubview:
Thanks for any constructive advice,
Regards,
Alex
_______________________________________________
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