Non-Contextual Popup Menus using NSPopupButtonCell and attachPopupWithFrame or performClickWithFrame
Non-Contextual Popup Menus using NSPopupButtonCell and attachPopupWithFrame or performClickWithFrame
- Subject: Non-Contextual Popup Menus using NSPopupButtonCell and attachPopupWithFrame or performClickWithFrame
- From: "Oliver Kurek" <email@hidden>
- Date: Tue, 8 Jan 2008 09:52:30 -0500
Reading through the documentation regarding contextual popup menus, Apple
notes that the prefered method of popping up a non-contextual menu is using
an NSPopupButtonCell and using the attachPopupWithFrame:inView method.
After attempting this on my own with little luck, and browing Google, I
found that others had issues with using attachPopupWithFrame:inView, and
suggested to use performClickWithFrame:inView instead. Specifically, when
using the former, no menu appears at all. With the latter, the menu pops
up, but it does not appear at the position of the mouse pointer. Instead,
the menu appears to popup at roughtly the right horizontal position on
screen, but always at the bottom edge of the view.
The particular situation I have is an NSTextView that is subclassed, which
occasionally includes text formated as a link with a custom-handled link
object. When the link is clicked, a menu is generated based on the details
of the link and popped up.
Is there any way to have this menu pop up at the position of the mouse
pointer? Has anyone had success using attachPopupWithFrame:inView rather
than performClickWithFrame:inView?
Any help would be greatly appreciated!
Thanks,
Oliver Kurek
_______________________________________________
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