[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-swt-dev] natives with project builder.
|
Hi Andre,
In the JDirect sample, why is the first line a call into AWT?
new java.awt.Frame().pack();
The sample doesn't quite work with it removed - but this would
explain why the AWT event thread was getting into the picture.
..Mark..
On Saturday, January 19, 2002, at 01:32 AM, Andre Weinand wrote:
Hi Mark,
One question: for the "real" version, are you planning to stick
with the old
WaitNextEvent mechanism, or go for the new Carbon Event Manager stuff?
I tried the Carbon Event Manager in my JDirect version but I
couldn't get it to work
reliable (see attached archive).
Therefore I decided to stick with the old WaitNextEvent mechanism
for the following reasons:
- it just seems to work better :-)
- SWT uses a similar approch: every SWT application has one or
more event loops.
- Setting up Carbon callbacks (UPPs etc.) in JNI is not really
fun. It is much easier to
call callbacks from Java code.
The WaitNextEvent approach gives me exactly that: I have to
transfer the
event from Carbon to Java via JNI, and then I can dispatch it in
Java code only.
In addition the resulting system is much easier to understand
because you can "see" where,
when, and from which context a callback is fired.
However, as soon as Eclipse works with WaitNextEvent, I'm willing
to migrate to a Carbon Event Manager based solution. This should
not have an impact on the overall architecture of SWT for MacOS X.
It just means a low-level DoHandleEvent will go away.
-- andre