Re: Displaying a menu at arbitrary location.
Re: Displaying a menu at arbitrary location.
- Subject: Re: Displaying a menu at arbitrary location.
- From: Alex Keresztes <email@hidden>
- Date: Sun, 12 May 2002 19:08:21 -0500
Since NSButton is a subclass of NSView, you could use NSView's method:
- (NSMenu *)menuForEvent:(NSEvent *)theEvent
Take a look at the docs on NSView for more info.
Alex
On 5/12/02 5:23 PM, "Nicholas Riley" <email@hidden> wrote:
>
On Sun, May 12, 2002 at 08:59:53PM +0800, Gideon King wrote:
>
> I am implementing a pop-up icon button as described in the HI guidelines
>
> document. In order to do this, I need to be able to display a menu just
>
> below the button that is clicked, aligned with the left side of the
>
> button. As NSMenu doesn't have any relationship with NSView, I'm not
>
> sure how to display the menu where I want it.
>
>
>
> NSPopupButton doesn't help as the menus don't display in the right place
>
> and also won't display large images. Context menus don't seem to help as
>
> there seems no way to control where they display.
>
>
>
> Any pointers on how to display a menu where I want it would be
>
> appreciated.
>
>
The best you can do in Cocoa, afaik, is to pop up a menu (see NSMenu
>
docs). But this essentially creates a contextual menu, which means
>
contextual menu plugins get inserted, and that can be very ugly.
>
>
Otherwise I think you need to use Carbon.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.