On Sep 13, 2006, at 1:41 AM, Rob Ross wrote:
I am trying to get a simple native Cocoa API method to work via
JNI. I want to try to hide all other applications.
I seem to have two choices, by calling -hideOtherApplications on
either NSApplication or NSWorkspace. But neither seems to be
working for me.
I coded it like this...
import macnative.jnidirect.cocoa.application.NSApplication;
public class AppTesting {
public static void main(String[] args) {
NSApplication app = NSApplication.sharedApplication();
app.hideOtherApplications(0);
}
}
When run from Terminal it did nothing. When run from my application
it appeared to work. I had to quit the application to get the other
applications to show back up.
I've seen this before and think it may be because the application
provides a full-blown AppKit derived Swing/AWT/GUI'd application
that terminal does not provide.
<shame-less plug>
Use my java command line application to test your Cocoa JNI using
quick and dirty command line tests
It is actually a full-blown AppKit derived SwingAWT/GUI'd
application that looks and works something like Terminal.
</shame-less plug>
Or anyhow test somehow from your own full-application and don't
expect everything to work right from simple CLI based tools.
Mike Hall mikehall at spacestar dot net
http://www.spacestar.net/users/mikehall
http://sourceforge.net/projects/macnative