Re: adding menu items and making them work [Java]
Re: adding menu items and making them work [Java]
- Subject: Re: adding menu items and making them work [Java]
- From: Fritz Anderson <email@hidden>
- Date: Wed, 6 Oct 2004 08:37:36 -0500
My Cocoa-Java is not sharp, and this may be just a typo, but I believe the signature for your closePatient() method is closePatient:, not closePatient:: .
-- F
On 5 Oct 2004, at 7:13 PM, John Spicer wrote:
I'm trying to add an item to a menu and get it to work (enabled).
This is the code:
NSMenu theMenuBar = NSApplication.sharedApplication().mainMenu ();
NSMenuItem theView = theMenuBar.itemWithTitle("View");
NSMenu theViewMenu = theView.submenu();
NSMenuItem item = new NSMenuItem("Herbert, Frank", new NSSelector("choosePatient::", new Class[] {getClass()}), "");
item.setEnabled(true);
item.setTarget(this);
theViewMenu.addItem(item);
public void choosePatient (Object sender)
{
NSApplication.beep ();
}
Everything compiles and runs OK. But the menu item will not enable.
_______________________________________________
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