Component with a native window backing it?

Hi all -

I need a component with an actual window (NSView or UIView) backing it; what is the correct way to approach this?




Yes, I assumed that.

What I did was have a SomeComponent : public NSViewComponent() ...

But the SomeComponent's native handle is the same as its parent... something is wonky with how I'm using it, I think.

That class doesn't do anything until you actually give it an NSView to hold.

OK.  So what is the right way to go about having a Component which has a real window backing it?  I know that a DocumentWindow has such a window, but are there other components I could use for the purpose or do I have to roll my own?

What I want is a plain component whose handle I can give to an OS function

What I see is that a component which is a child of another component ends up using the parent's peer instead of its own.  I need it to keep its own peer

Maybe what you need is to use a normal component and use addToDesktop to add it to a parent window?

Hi, again -

That seems to work, sort of.   But the component now draws in an odd location.  How can I make it be the size of the parent component?

I tried setBounds("0,0,parent.width,parent.height") but it seems to not be happy.  However, we are getting closer...

Something seems to be going on with mapping coordinates; (0,0) is towards the bottom of the window on the left, and if I give a coordinate of (0,-400) for the top-left, the embedded window goes up.

Does this make any sense to you?