• 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
Re: Java-Cocoa: NSMenuItem.separatorItem()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Java-Cocoa: NSMenuItem.separatorItem()
      • From: Manfred Schwind <email@hidden>
References: 
 >Java-Cocoa: NSMenuItem.separatorItem() (From: Manfred Schwind <email@hidden>)

  • Prev by Date: SMySQL
  • Next by Date: Re: finding header files
  • Previous by thread: Java-Cocoa: NSMenuItem.separatorItem()
  • Next by thread: Re: Java-Cocoa: NSMenuItem.separatorItem()
  • Index(es):
    • Date
    • Thread