• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
subview within NSView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: subview within NSView?
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Round Rect
  • Next by Date: Re: subview within NSView?
  • Previous by thread: Re: NSImage Path
  • Next by thread: Re: subview within NSView?
  • Index(es):
    • Date
    • Thread