• 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
[ANSWERED] Re: Getting a question answered
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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
References: 
 >Getting a question answered (From: Alan Francis <email@hidden>)
 >Re: Getting a question answered (From: Nick Zitzmann <email@hidden>)
 >Re: Getting a question answered (From: Alan Francis <email@hidden>)

  • Prev by Date: Re: Reports via NSView and NSString drawAtPoint:
  • Next by Date: Re: remove undo actions for NSTextView
  • Previous by thread: Re: Getting a question answered
  • Next by thread: Re: Getting a question answered
  • Index(es):
    • Date
    • Thread