[ANSWERED] Re: Getting a question answered
[ANSWERED] Re: Getting a question answered
- Subject: [ANSWERED] Re: Getting a question answered
- From: stephane sudre <email@hidden>
- Date: Mon, 11 Oct 2004 11:54:29 +0200
On Oct 10, 2004, at 9:19 AM, Alan Francis wrote:
Apologies to all.
New baby == sleepless nights == tense and impatient Dad.
I'm calmer now (he's sleeping on his mum).
Apologies again.
BTW, the answer to your original question:
- (void)mouseDown:(NSEvent *)theEvent
{
NSEvent * tEvent;
NSPoint tPoint;
NSRect tBounds=[self bounds];
tPoint=NSMakePoint(0,NSHeight(tBounds)+5);
tPoint=[self convertPoint:tPoint toView:nil];
tEvent=[NSEvent mouseEventWithType:[theEvent type]
location:tPoint
modifierFlags:[theEvent modifierFlags]
timestamp:[theEvent timestamp]
windowNumber:[theEvent windowNumber]
context:[theEvent context]
eventNumber:[theEvent eventNumber]
clickCount:[theEvent clickCount]
pressure:[theEvent pressure]];
[NSMenu popUpContextMenu:[self menu] withEvent:tEvent forView:self];
}
The cons of this method is that you might end up getting your popup
menu polluted with Contextual Plugins.
One solution is to use hidden APIs. Just so you want to hit your head
against the wall, here is a reference to a recent post:
http://www.cocoabuilder.com/archive/message/2004/10/2/118703
There's one mistake in the description, the location is local not
global.
_______________________________________________
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