Re: How to build a popup menu and show this menu?
Re: How to build a popup menu and show this menu?
- Subject: Re: How to build a popup menu and show this menu?
- From: Scott Anguish <email@hidden>
- Date: Thu, 23 Feb 2006 02:10:13 -0500
On Feb 23, 2006, at 2:01 AM, wlq wrote:
I means that I want show a popup menu when my window receive
right mouse down message.
In fact, the popup menu I want to show is not a true popup menu.
This "menu" is more like a pallete bar.
Is there some way to implement this bar?
There isn't any support for creating a popup palette like I think
you're talking about. And it is a rather non-standard UI that I
think you're proposing. If you want this exactly, you would need to
handle it by yourself, either inserting a view into the window's
hierarchy temporarily and handling everything yourself, or floating a
window above the other window temporarily, and handling everything
yourself...
But.. if you do this with a contextual menu (which is what most apps
do it with) you'd want to create a menu in IB as joar suggested, and
then set it as a context sensitive menu by overriding the NSView
methods -menuForEvent: or +defaultmenu.
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSView.html#//apple_ref/doc/uid/
20000014-DontLinkElementID_1518
There is no significant conceptual documentation for these two
methods... it is mentioned in the Application Menus and Pop-up Lists
book. And the Clock Control (available via ADC) does implement it.
that should be enough to get you going..
_______________________________________________
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