Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I put a view in a window so that the WindowController (ie: Files Owner) of the window can communicate with the custom view?

0
Posted

How do I put a view in a window so that the WindowController (ie: Files Owner) of the window can communicate with the custom view?

0

• select Classes tab • select NSView in the list of classes • choose Classes – Subclass NSView • name youre view (eg: AndyView • choose Classes – Create Files for AndyView • make sure the file browser that appears points to your project root or suitable subdir and the project is checked in the Insert Into Targets list on the save dialog in Interface Builder, to add your custom view to a window • make the Window visible • click on the Cocoa-Containers panel in the Palettes window (icon is a tab panel, the 6th along) • drag a CustomView onto the window • resize as desired • bringup the Info panel for your Custom View to link the view so it is programmatically addressable from the window controller: • add an outlet member variable to the controller, eg: IBOutlet AndyView* importantView; • save these changes • in Interface Builder:

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123