-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What EventDrive* should I use to react to WinAPI gui messages? #174
Comments
On Windows, you should use the default "WinAPI" driver. It will use If you need any advanced message processing, such as classical dialog handling ( |
I understand that from the source code easily. But I can't realize what API should I use to add a callback, the event driver has the individual driver features like |
This is done via the window procedure, which is set using |
Ok, I see. So eventcore encapsulates native windows message loop. But when I register a class and create the window, eventDriver exits the event loop because it has zero waiters. So I need to do something more... |
I added a dummy timer and the native window works as expected except on closing the window event loop continue to work because of the dummy timer. Probably better would be to create a dummy event and then sending it on WM_DESTROY message to gracefully exit of event loop. Is it right (ideomatic to eventcore) approach? |
Now I create an event and trigger it on WM_DESTROY. It works but I get:
But as I can see the event callback is removed on triggering and eventcore does not provide API to remove an event manually. How to exit the event loop gracefully? |
Interesting, I never came across this issue, apparently because vibe-core starts to wait for an event ( I wonder if that should be something to document as a recommended way to handle windows, or if there should rather be a Windows-specific API addition, such as exposing |
|
In X11 I adopt display fd by means of
EventDriverSockets.adopStream
and usewaitForData
to register a callback. But I can not realize what to do in case of Windows...The text was updated successfully, but these errors were encountered: