detecting mouseDown events in subviews
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.