Re: Java-Cocoa: NSMenuItem.separatorItem()
Re: Java-Cocoa: NSMenuItem.separatorItem()
- Subject: Re: Java-Cocoa: NSMenuItem.separatorItem()
- From: Moray Taylor <email@hidden>
- Date: Fri, 16 Jul 2004 22:03:32 +0100
Hi,
I'm not entirely sure what you mean, but I have used the separator item
in a Cocoa Java app with no problems, like this
TheMenu.addItem(new NSMenuItem().separatorItem());
Does this help?
Cheers
Moray
Hi there,
I am programming a Java-Cocoa GUI for a Java application. Now I wanted
to insert a separator item in an NSMenu, and in the NSMenuItem class I
found the following:
public class NSMenuItem ...
...
public com/apple/cocoa/application/NSMenuItem separatorItem() {
}
...
}
What's this?!? Are there really three errors in this method?
In my opinion it has to be static (a class method), it has to be
native and it should not have an empty implemenation (the
implementation has to be somewhere inside the Java-Cocoa-Bridge as
usually).
So in my opinion it should look like this instead:
public class NSMenuItem ...
...
public static com/apple/cocoa/application/NSMenuItem separatorItem();
...
}
Is this a bug? Or is it just not implemented (yet)? Should I file a
bug report?
The corresponding method (selector ;-)) in Obj-C is correctly defined
this way:
+ (id <NSMenuItem>)separatorItem;
I am using the following class method for now, but the name
"_NSObsoleteMenuItemProtocol" does not let me feel good: ;-)
public static native
com/apple/cocoa/application/_NSObsoleteMenuItemProtocol
protocolSeparatorItem();
Casting _NSObsoleteMenuItemProtocol to NSMenuItem seems to work
perfectly in this case.
Bye,
Mani
_______________________________________________
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.
_______________________________________________
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.