Re: java cocoa appkit application and multiple threads
Re: java cocoa appkit application and multiple threads
- Subject: Re: java cocoa appkit application and multiple threads
- From: "Nick Emery" <email@hidden>
- Date: Tue, 26 Jun 2001 08:35:00 +0100
- Organization: Peramon technology Ltd
Michael Dupuis wrote:
>
A couple of questions since you've gotten it to work, if you'd permit me.
>
Did you wind up creating a new NSEvent and handing that event in a NSWindow
>
subclass? I seem to be having a problem getting my subclass to display
>
correctly. If I don't define any of the NSWindow constructors in my
>
subclass, than my window never appears. If my subclass implements the
>
NSWindow constructors, then I get a frameless window. It appears as though
>
the window has a mask of BorderlessWindowMask. I haven't tried to subclass
>
any of the Cocoa objects yet, so I'm not sure what's going on. I'm not doing
i create a new event which i then process in a subclass of NSApplication. like you, i tried to subclass NSWindow and got a frameless window (and other drawing anomalies), so subclassing NSApplication seemed like an alternative. of course it is a little bit more complicated, because you have to work out from the event which window object (delegate in my case) needs to process it.
>
anything in my constructors other than passing the values to super(). Any
>
ideas? I can't find anything that explicitly says how to subclass an
>
NSWindow, so I'm obviously doing it wrong and forgetting something.
>
i'd like to know the solution to this also.
>
Also when you created your NSEvent, did you create it like this?
>
>
NSEvent.otherEvent(NSEvent.ApplicationDefined,
>
new NSPoint(0,0), 0, 0.0,
>
owner.window().windowNumber(), null, THREAD_ID,
>
-1, -1);
>
>
or something like this? I wasn't able to find a way to get a value for time,
>
which is supposed to be the time since startup.
>
yes, i use something like this:
NSEvent.otherEvent (NSEvent.ApplicationDefined, zero0, 0, 0.0, win_num,
null, stopIndeterminate, 0, 0)
where zero0 is a static new NSPoint (0,0). win_num is saved during window creation, after the window has been displayed. if you fetch it dynamically, and the window is minimized, then you'll get a zero which may not be what you are expecting. stopIndeteminate is just one of my sub event types.
as you can see, i don't bother with the time. again, like you, i could not find an appropriate method in the supplied frameworks.
hope this helps --nikki