Java, NSApplication, & NSWindow
Java, NSApplication, & NSWindow
- Subject: Java, NSApplication, & NSWindow
- From: Maurice Parker <email@hidden>
- Date: Mon, 26 Nov 2001 23:21:47 -0600
Hey,
I have a very simple Java program that is doing something that has perplexed
me for about a day and a half. The program creates a NSApplication and then
creates and opens a NSWindow. Everything pretty much works as expected, but
when I close the window, I get a segfault. What I expected to happen, was
to have the application continue to execute, minus the window.
Am I doing something boneheaded or is this a bug? Here is an example of the
behavior:
import com.apple.cocoa.application.*;
import com.apple.cocoa.foundation.*;
public class Test {
public static void main (String [] args) {
NSApplication nsapp = NSApplication.sharedApplication();
NSRect rect = new NSRect(100, 100, 100, 100);
int style = NSWindow.ClosableWindowMask | NSWindow.TitledWindowMask
| NSWindow.ResizableWindowMask|
NSWindow.MiniaturizableWindowMask;;
NSWindow window = new NSWindow(rect, style, NSWindow.Buffered,
false);
window.makeKeyAndOrderFront(window);
nsapp.run();
}
}
Any help is appreciated.
-Maurice