Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] JUnit test for Display.post(Event)


I'm trying to help fill in some of the junit tests for SWT, but have hit a snag with Display.post(Event).
I was able to successfully invoke post for the supported events (ie, the API returned true), but I'm trying to verify that the events truly were posted. To do so, I created a shell, made sure it had focus and added Key, Mouse and MouseMove listeners. However, the only listener that got triggered was for MouseMove. I don't seem to be able to catch KeyDown/Up or MouseDown/Up. I also tried adding a Text widget and giving it focus, but still no key events (or mouse events). Presumably I was able to receive the MouseMove event since I provided the x/y location which was within my shell and SWT uses that to identify the target widget for the event. However, neither the Key nor Mouse events require any sort of source widget information in the event, so how will the event be dispatched?
Could this be a bug or is there something I'm misunderstanding about how to use this API? BTW, I'm testing on Win2K.

    Stef

Back to the top