Dock Menu
Dock Menu
- Subject: Dock Menu
- From: Marcus <email@hidden>
- Date: Sat, 5 Jan 2002 15:58:47 +1300
Hi, how are you?
I have a problem which some of you may be able to give me guidance
on. I have looked through the dock menu tutorial on
cocoadevcentral.com.
My app (JellyfiSSH) is a SSH bookmark manager, which I release for
free to the OS X community. I have been looking to implement a dock
menu for 'one-click' access to the SSH bookmarks.
I have created a dynamic menu - which is all working fine. I want
each of the items to be enabled in the dock - so when a user
releases, it should call a function called Dock_Action - which is
defined with a simple dialog and set as the Action.
My problem is that the dock_menu_items are all there - but they are greyed out.
In my NIB, the File's Owner delegate Output is connected to my App -
so that seems to work OK.
Here is my code (Inside a Loop in which dock_menu_text gets new text
every iteration)
.
<snip>
if (dock_menu == nil)
{
dock_menu = [[NSMenu alloc] init];
}
dock_menu_item = [[NSMenuItem alloc] initWithTitle:[NSString
stringWithFormat:@" %@", dock_menu_text] action:NULL
keyEquivalent:@""];
[dock_menu_item setAction:@selector(Dock_Action:)];
[dock_menu_item setTarget:self];
[dock_menu_item setEnabled:true];
[dock_menu addItem:dock_menu_item];
[dock_menu_item release];
</snip>
I have tried all sorts of combination to get this to work - could you
give me some pointers?
Thanks in advance
Marcus
--
========================================================
"Always ask the question, never assume the answer."
Marcus Radich 1999
========================================================