• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Java-Cocoa: NSMenuItem.separatorItem()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Java-Cocoa: NSMenuItem.separatorItem()


  • Subject: Java-Cocoa: NSMenuItem.separatorItem()
  • From: Manfred Schwind <email@hidden>
  • Date: Fri, 16 Jul 2004 22:39:21 +0200

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.


  • Follow-Ups:
    • Re: Java-Cocoa: NSMenuItem.separatorItem()
      • From: Moray Taylor <email@hidden>
  • Prev by Date: Re: How to make an application non-executable?
  • Next by Date: SMySQL
  • Previous by thread: Re: Help Reader
  • Next by thread: Re: Java-Cocoa: NSMenuItem.separatorItem()
  • Index(es):
    • Date
    • Thread