• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSView subview covering a control
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView subview covering a control


  • Subject: Re: NSView subview covering a control
  • From: Guy English <email@hidden>
  • Date: Tue, 14 Dec 2004 18:35:17 -0500

Try subclassing NSView and making it MyLayeredView.
If MyLayeredView:

- (void) setUnderlyingLayerView: (NSView*) newUnderView
{
    [newUnderView retain];
    [underView release];
    underView = newUnderView;
}

- (NSView*) hitTest: (NSPoint) point
{
    NSView *hitView;

    hitView = [super hitTest: point];

    if ( hitView == self )
    {
        return [underView hitTest: point];
    }
    else
    {
        return hitView;
    }
}

I say try because I really don't know if that'll work. But it's worth a shot.

Guy

On Tue, 14 Dec 2004 18:34:21 -0400, Alexander O'Neill
<email@hidden> wrote:
> Hi everyone,
>
> What I'm trying to do is have a GUI that is contained in multiple
> layers, contained in NSViews.
>
> So I have roughly a background layer, a content layer, and a front
> layer.
>
> The content layer and the front layer both have controls on them, i.e.,
> buttons, etc.
>
> I can create them from NIB files, and swap out different NSView objects
> from at each layer.
>
> The one problem I'm having is that the topmost NSView is 'eating' all
> of the mouse events that I want to go to the controls I've created on
> the content layer of which the front view is a subview.
>
> Calling setNextResponder to the content view on the front view doesn't
> seem to work for me.
>
> Is there a way to do it so taht if I don't click on a control in the
> front view that the mouse event will be sent to the control that was
> created as part of the content view?  The button is visible, it just
> doesn't respond to clicks.
>
> Any help would be greatly appreciated.
>
>                 -- Alexander
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev 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.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSView subview covering a control (From: "Alexander O'Neill" <email@hidden>)

  • Prev by Date: info on books
  • Next by Date: Re: info on books
  • Previous by thread: Re: NSView subview covering a control
  • Next by thread: info on books
  • Index(es):
    • Date
    • Thread