• 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
detecting mouseDown events in subviews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

detecting mouseDown events in subviews


  • Subject: detecting mouseDown events in subviews
  • From: email@hidden
  • Date: Sun, 19 May 2002 11:51:29 -0500

I am creating a custom view to as a custom status item. Here is the code in the initWithFrame message of my custom view:
- (id)initWithFrame:(NSRect)frame {
NSRect bgRect;
NSPoint bgOrigin;
self = [super initWithFrame:frame];
if (self) {
imageView = [[NSImageView alloc] init];
bgImageView = [[NSImageView alloc] init];
bgRect = frame;
bgRect.origin.x = bgRect.origin.x - bgRect.size.width - 1;
image = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"small_G4icon" ofType:@"png"]];
[imageView setEditable:NO];
[imageView addSubview:self];
[imageView setImage:image];
[imageView setFrame:[self frame]];
[imageView setNextResponder:self];
[[self window] makeFirstResponder:self];
framingRect = [NSBezierPath bezierPathWithRect:[self frame]];
[self setIsHighlighted:NO];
}
return self;
}

How can I detect mouseDown and mouseUp events with the imageView?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: AltiVec optimization in Cocoa?
  • Next by Date: Window visiblity and Check Boxes
  • Previous by thread: Re: NSStepper and Time
  • Next by thread: Re: detecting mouseDown events in subviews
  • Index(es):
    • Date
    • Thread