[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-swt-dev] MacOS X port status?
|
Maurice,
Can you point me to an example of this being done in the Examples or the
Eclipse source? IMHO the message pump (readAndDispatch / sleep) shouldn't
be exposed outside of the SWT packages anyway. Everyplace that I have have
seen readAndDispatch used, nothing interesting is happening in the loop
anyway.
I just searched for all references to readAndDispatch in an Eclipse workspace
and found 15 occurences, one of them org.eclipse.jface.operation.ModalContext.
This case and others use readAndDispatch to implement a form of modality.
Combined with the fact that readAndDispatch does *not* guarantee that it
will return after processing a single event (it may have some others it
needs to process), I didn't think that I was breaking it's behavior too
badly.
I've read the doc again and I think that it processes at most one OS event
and possibly more inter-thread messages.
May be somone from the SWT team can help?
I could be wrong. Show me where an application does something interesting
while in message pump loop and I will have to change my opinion. ;-)
I think nobody does anything interesting in an event loop besides having a
special expression for terminating the loop and leaving the modal mode.
Bottom line though is that if I do have to do a message pump style event
model, NSApplication can be subclassed and all events sent from the Window
Manager to the application can be intercepted by overriding sendEvent() and
put into a queue that readAndDispatch works it's way through.
Yes, that sounds feasible.
I'll try whether I can get some of
Eclipse's special uses of readAndDispatch() to work.
Thanks,
--andre