-
Notifications
You must be signed in to change notification settings - Fork 14
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
Added an explanation of how to use events to the create-window example #1
Conversation
added example of reading events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, if you run the create-window example and close the window, the underlying Go Program keeps running.
How running? On Ubuntu if I close the window, i got the program terminated with output:
XGB: xgb.go:455: A read error is unrecoverable: EOF
Both event and error are nil. Exiting...
Here is also an example of how to listen to key |
Now I remember. I've encountered this before. On some (well behaved) DEs the UnmapNotify and DestroyNotify is not sent just the connection is closed, unless you add WM_DELETE_WINDOW to WM_PROTOCOLS property. Could you mention this in comment in the DestoyNotifyEvent, please? |
sure thing. You're using stock ubuntu (so I can mention your DE as an example for closing = killing the X conection)? I also have an example for drawing coming up which you can consider adding, I just have to add comments for everything. |
Here it is. I think I'm done |
I also added some text drawing in there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks a lot better, but I have a few demands. Thank you for bearing with me and implementing my requests so far.
You're using stock ubuntu (so I can mention your DE as an example for closing = killing the X conection)?
I use Ubuntu MATE right now, but I think, stock ubuntu does the same. I have to test it, but for now let's assume it's happening on stock ubuntu too. 😆
Edit: Tested it on stock Ubuntu 20.04, no DestroyNotifyEvent, like in MATE.
No worries, I am a perfectionist myself ;) I think it should all be in there. |
Just added an missing "\n" and merged. Thank you. Also I'm interested in the shapes example. I myself like to learn from examples, so I think the more examples, the better. ;) |
Hello,
first, I think that the default examples are very helpful and well documented.
However, if you run the create-window example and close the window, the underlying Go Program keeps running.
I think this is a good use case for the
DestroyNotifyEvent
and demonstrating how reading it / reading events in general works.So I added these simple lines to the demo.