Re: Not receiving mouseDown/Up events in borderless window . . .
Re: Not receiving mouseDown/Up events in borderless window . . .
- Subject: Re: Not receiving mouseDown/Up events in borderless window . . .
- From: "Michael A. Crawford" <email@hidden>
- Date: Mon, 14 Sep 2009 14:47:38 -0400
Ok. I went back and did some experimenting and it doesn't look good.
First of all the ignoresMouseEvents property was already set to NO.
Assuming I had some issue with intercepting mouse clicks at the
NSWindow level when an NSView was present, I decided to implement
support for event handling in my NSView derived class. Again the code
works but only on Snow Leopard. On 10.5 I'm just not seeing those
mouse clicks.
When I say 'not seeing' I'm talking about empirical evidence. My
software doesn't respond by closing the windows or doing anything else
I've programmed it to do when the mouse is clicked in one of my
views. My tester is reporting the same problem when he runs the code
on his 10.5 system.
I'm building this code on 10.6 with Xcode 3.2. This is my development
machine, which I foolishly upgraded. I no longer have a Leopard
development system running Xcode 3.1. How can I see what is going on
on my Leopard test system? I'm building using the 10.5 SDK since I
want my app to run on both 10.5 and 10.6 as a 32-bit app. With a
debug build, is there anyway to see debug console output on my test
machine running the binary I build using Xcode 3.2?
Obviously this is my problem. If it were the case than anyone
processing events in windows and views on 10.5 using a binary built on
10.6 with Xcode 3.2, I would have heard about it.
In case you are curious, here is the experimental code.
@class CDImageView;
@protocol CDImageViewDelegate
- (void)mouseUp:(NSEvent*)event onImageView:(CDImageView*)imageView;
@end
@interface CDImageView : NSImageView
{
id<CDImageViewDelegate> delegate;
}
@property (nonatomic, assign) id<CDImageViewDelegate> delegate;
@end
@implementation CDImageView
@synthesize delegate;
- (void)mouseUp:(NSEvent*)event
{
[self.delegate mouseUp:event onImageView:self];
}
@end
-Michael
On Sep 12, 2009, at 10:36 PM, Ken Thomases wrote:
On Sep 12, 2009, at 9:12 PM, Michael A. Crawford wrote:
I have created a borderless window that is used to display a custom
graphic, which need to respond to the enter key or a mouse click by
closing itself. Seems straightforward enough. It works great on
Snow Leopard (10.6) but I do not get the mouse events on Leopard
(10.5). Hitting the enter key works on both.
Anyone seen this behavior before? I've included the code so you
could see if I've left something out.
I think you need to setIgnoresMouseEvents:NO. I believe that
windows which are transparent below a certain threshold ignore mouse
events by default.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden