Re: Problem adding a background NSImageView in a Cocoa View AU?
Re: Problem adding a background NSImageView in a Cocoa View AU?
- Subject: Re: Problem adding a background NSImageView in a Cocoa View AU?
- From: "tahome izwah" <email@hidden>
- Date: Thu, 29 Nov 2007 08:37:46 +0100
Hi Jorge,
thanks for the info. How would you do this in an AU plug in that has a
cocoa view, then? Are you saying that the only way to do this is
programmatically, and not via IB? Why?
I am looking at the WaveformViewDemo AU right now (because I can't get
a Cocoa View plug in to build using the template). It appears that it
has a WaveformViewDemoView as its main view, and everything else is a
subview of this. Now, if I insert an NSImageView using IB, it becomes
a sub view of this WaveformViewDemoView as well. If I order it to the
back it has no effect, it is always displayed at the front. The same
thing is true for all the other views, their front-to-back ordering
seems to have nothing to do with what I assign to them in IB. Since
these views usually don't overlap you wouldn't notice, but I want my
plug in to have a pitcure in the back.
I don't understand why this could be so difficult, after all, I would
think that a backdrop image is the first thing someone who builds a
plug in would like to have, wouldn't you agree?
Or am I missing something?
Thanks again
--th
2007/11/28, Jorge Castellanos <email@hidden>:
> tahome,
>
> The problem you are experiencing is because in Cocoa you can't have
> overlapping views. What you can have is subviews.
> Usually, a window has a "content view" which holds all its subviews,
> but all of these connections are handled behind the scenes during nib
> loading and initialization.
>
> The easiest solution is to write a custom NSView that draws the image
> in "drawRect: " and then just set this view as the "contentView" of
> the window.
>
> hope that helps
>
> jorge castellanos
>
>
>
> >
> > I'm currently trying to figure out the best way to set a background
> > image for the UI that I am creating using Xcode 3 in Leopard. The
> > background image should fill the whole view and be the backdrop image
> > for all the controls in that window. However, this doesn't seem to be
> > an easy task...
> >
> > I have modified the WaveFormDemo plug NIB file to have a NSImageView
> > with my picture in the background and have used the "send to back"
> > layout option. When I run the plug in the image is displayed and all
> > other controls are there as well, but no matter what I do, my Image
> > View is alway the frontmost view hiding the controls.
> >
> > I have looked everywhere and double checked that the NSImageView is
> > indeed in the back, but no matter what I do my image ends up on top of
> > everything else once I run the plug in. This is independent of the
> > host that I use it with, so I guess it must be a problem with the plug
> > in, not the host.
> >
> > The funny thing is that if I create a Cocoa App and paste the very
> > same UI into the content view of its window everything works
> > beautifully. I really must be missing something here...
> >
> > HELP - I am really pulling my hair out over this one!!
> >
>
>
>
>
> _______________________________________________
> 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
>
_______________________________________________
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