FROM : Corbin Dunn
DATE : Wed Nov 28 19:48:02 2007
On Nov 28, 2007, at 9:10 AM, Tim Perrett wrote:
> Hey Corbin
>
> Thanks for the reply. Ive been looking at the DragNDropOutlineView
> example, and I found this comment
>
> "On MacOS 10.5 and later, in willDisplayCell: we can dynamically set
> the contextual menu (right click menu) for a particular cell. If
> nothing is set, then the contextual menu for the NSOutlineView
> itself will be used. We will set a different menu for the
> "Expandable?" column, and leave the default one for everything else."
>
> Which Im guessing is what you meant about making it easier in 10.5?
> Isn't that using NSMenu however? rather than a panel which I belie
> those little HUD windows are?
Tim -- you are right. I am talking about NSMenu, but your original
email seems to indicate that is what you wanted:
> What I would like to end up with is on my outline view (that already
> works no problems), when the user right-clicks one of the rows, I
> would like that one to become the selected row, and a context menu
> to popup beside, from which I can set some parameters. I have read
> about the menu outlet, but im not sure if thats the right way to go,
> and even if it is, what it needs to be connected to?
A context menu is a regular menu; not a HUD. I would discourage you
from creating UI that does something other than pop up a context menu
on the right click; it won't be what people expect, and isn't easily
discoverable. Apps that use HUD's typically bring them up in some
other way. For instance, they have a button in the cell to bring it
up, a toolbar item (Aperture), or an item in the context menu itself
(iCal).
If you really want to do a HUD, you will probably have to subclass
NSTableView, override mouseDown:, call super (to do all the work of
tracking and changing the selection), and then show your HUD if it was
a right click.
--corbin
DATE : Wed Nov 28 19:48:02 2007
On Nov 28, 2007, at 9:10 AM, Tim Perrett wrote:
> Hey Corbin
>
> Thanks for the reply. Ive been looking at the DragNDropOutlineView
> example, and I found this comment
>
> "On MacOS 10.5 and later, in willDisplayCell: we can dynamically set
> the contextual menu (right click menu) for a particular cell. If
> nothing is set, then the contextual menu for the NSOutlineView
> itself will be used. We will set a different menu for the
> "Expandable?" column, and leave the default one for everything else."
>
> Which Im guessing is what you meant about making it easier in 10.5?
> Isn't that using NSMenu however? rather than a panel which I belie
> those little HUD windows are?
Tim -- you are right. I am talking about NSMenu, but your original
email seems to indicate that is what you wanted:
> What I would like to end up with is on my outline view (that already
> works no problems), when the user right-clicks one of the rows, I
> would like that one to become the selected row, and a context menu
> to popup beside, from which I can set some parameters. I have read
> about the menu outlet, but im not sure if thats the right way to go,
> and even if it is, what it needs to be connected to?
A context menu is a regular menu; not a HUD. I would discourage you
from creating UI that does something other than pop up a context menu
on the right click; it won't be what people expect, and isn't easily
discoverable. Apps that use HUD's typically bring them up in some
other way. For instance, they have a button in the cell to bring it
up, a toolbar item (Aperture), or an item in the context menu itself
(iCal).
If you really want to do a HUD, you will probably have to subclass
NSTableView, override mouseDown:, call super (to do all the work of
tracking and changing the selection), and then show your HUD if it was
a right click.
--corbin
| Related mails | Author | Date |
|---|---|---|
| Tim Perrett | Nov 28, 13:29 | |
| David Spooner | Nov 28, 14:56 | |
| Corbin Dunn | Nov 28, 17:54 | |
| Tim Perrett | Nov 28, 18:10 | |
| Corbin Dunn | Nov 28, 19:48 | |
| Tim Perrett | Nov 28, 20:32 | |
| Corbin Dunn | Nov 28, 21:33 |






Cocoa mail archive

