Re: Questions for implementing pop-up contextual menus for Ctrl-Click and Right-Click
Re: Questions for implementing pop-up contextual menus for Ctrl-Click and Right-Click
- Subject: Re: Questions for implementing pop-up contextual menus for Ctrl-Click and Right-Click
- From: "Alan Smith" <email@hidden>
- Date: Tue, 21 Nov 2006 21:26:29 -0500
To answer your first question:
I would go with mouseDown: because you've already implemented it and
it gives you more functionality.
Second question:
I would set a BOOL so you know the menu is open. For example:
- (void)mouseDown:(NSEvent*)theEvent
{
if (isMenuVisible)
{
// It's open, also set isMenuVisible to NO if you close it.
}
// Your code.
if (Ctrl-Click || Right-Click)
{
isMenuVisible = YES;
[NSMenu popUpContextMenu: menu withEvent: theEvent forView: self];
}
}
Good luck, Alan
--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that religion really is unnecessary, then it
shall evolve."
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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