Plugin NSView


#1

Hi,
First, I’m new to Cocoa & Mac OS.
I’m developing a plugin. On Windows, all’s work fine.

But on MacOs:

I have NSView of application container for my plugin, let’s call it “containerView”.

I try following code:
///
MyComp *comp = new MyComp();

comp->addToDesktop(ComponentPeer::windowIsTemporary);

comp->setVisible(true);

NSView* pluginView = (NSView*) comp->getWindowHandle();

comp->setTopLeftPosition(0, 0);
comp->setBounds(0,0,200,200);

[contentView addSubview:pluginView
positioned: NSWindowAbove
relativeTo: nil];
///

And I get TWO views. One in contentView window and other on the desktop.
What I’m doing wrong?


#2

afaik, you shouldn’t have to do any specific objectiveC to generate plugin windows. Take a good long look at the stuff in the Examples folder and follow the patterns illustrated in those examples for creating a plugin

https://github.com/julianstorer/JUCE/tree/master/examples/audio%20plugin%20demo