Re: Problem adding a background NSImageView in a Cocoa View
Re: Problem adding a background NSImageView in a Cocoa View
- Subject: Re: Problem adding a background NSImageView in a Cocoa View
- From: "tahome izwah" <email@hidden>
- Date: Fri, 30 Nov 2007 08:19:43 +0100
Hi Jorge,
thank you so much for all your help! Please see below:
2007/11/30, Jorge Castellanos <email@hidden>:
>
> Yes, you could do thatt without writing custom code. In other words,
> just set an NSImage view to cover all the background and then add all
> other controls as subviews. The problem with this solution is that
> managing and maintaining controls in IB becomes a bit tricky.
That's exactly what I tried and it doesn't work. My NSImageView is
always drawn on top of everything else in that AU, no matter what I
do. The same structure works fine in an application, but not in an AU.
I suspect that the back-to-front ordering of the view hierarchy is not
respected in a Cocoa view AU when it redraws itself. Since the
majority of AUs that I have seen don't have overlapping views it might
be that this has gone unnoticed.
> Two comments:
>
> a) An easier way of doing it is getting rid of the background custom
> view in IB, and just set the "CustomView" of your window to be of the
> class of your view that draws custom code. You can do this from IB.
> Just select the window, switch to "outline view" and set the class of
> the custom view to be of type "myBackgroundDrawerView".
> This way is transparent and simple.
Not sure that I understand what you're doing here... I don't think
that I have access to the AU plug in's window in IB, from what I have
seen it's only a view that is populated with subviews (controls) and
the view is loaded by the host into its own window.
> b) The code you wrote below works, but there is an easier and shorter
> way to do it using Cocoa. In drawRect stick the following code:
[snip]
Thanks for the hint, that is indeed much cleaner. I was using the CG
calls since the WaveformDemoView uses them, and I basically just
copied the calls from somewhere else in the code.
While I'm at it, did you try creating a Cocoa view AU using the Xcode
3 template recently? It appears to be broken (a couple of other people
responded to me off-list and they seem to have the same problem in
Leopard). By "broken" I mean that the Cocoa view isn't being displayed
in AULab and other programs, just the generic view.
Again, thank you so much for all your help, Jorge!!
--th
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden