Solutions for Java launcher
Solutions for Java launcher
- Subject: Solutions for Java launcher
- From: "Paul J. Lucas" <email@hidden>
- Date: Tue, 13 Sep 2005 13:57:41 -0700 (PDT)
After a lot of tinkering, I seem to have managed to get the planets
into alignment and my launcher works. The last problem I had was that
everything worked except the Java application's menu bar didn't show at
all (not in the JFrame and not in the menu bar) despite the fact that
the application set the apple.laf.useScreenMenuBar property.
My main() previously was of the form:
int main() {
readInfoPlist();
startJava();
[NSApplication sharedApplication];
[NSApp run];
}
I switched from using that (trying to simulate the sample Apple code in
JavaSplashScreen) to using the code in the simpleJavaLauncher sample
Apple code, i.e.:
int main() {
readInfoPlist();
startJava();
CFRunLoopSourceContext ctx;
// ... init ctx
CFRunLoopSourceRef r = CFRunLoopSourceCreate( NULL, 0, &ctx );
CFRunLoopAddSource( CFRunLoopGetCurrent(), r, kCFRunLoopCommonModes );
CFRunLoopRun();
}
and it now works, i.e., the menu is displayed in the menu bar.
But can somebody explain why the former didn't work? And how to make
the former work? Aside from the fact that I'm really curious, I may
want to extend my launcher to include things like a splash screen for
which using the "Objective C and Cocoa way" would be easier.
- Paul
_______________________________________________
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