-
Notifications
You must be signed in to change notification settings - Fork 6
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
Mover causes crashes when removed from the GUI #54
Comments
Thanks again for finding a bug and coming up with a really simple example. This is kinda a note to myself, but I think I found the problem. First, when the mover is removed from the GUI, its I'm not totally sure how to fix this. I could add an |
I'm not very familiar with how glooey works in details, so I'll give my point of view in a more abstract way. If we consider the two points you gave, that are that:
the way I see it, it means that when the mover is removed, the removal itself should trigger the on_mouse_leave even to child widgets, since the mouse effectively left the mover (or, well, the mover left the mouse, if that makes sense, but from the children's point of view, it means the same). |
I agree with your intuition, but the problem is that the |
I might be mistaken, but I don't think pyglet "stores" mouse coordinates, at least the way I see it, it's made to only give coordinates during mouse events, so I agree that storing the mouse coordinates in the GUI seems a bit weird and doesn't really fit with pyglet. It wouldn't be horrible I suppose, but still not perfect. I don't want to be annoying, but I am wondering, in the usual case (not the widget removal case), if the user leaves a widget with the mouse, it should trigger both the on_mouse_motion and on_mouse_leave events, or is the motion event not always triggered (for example if the mouse goes fast enough for it to "teleport" directly from inside the widget to outside, without moving inside the widget along the way, or if the mouse it at the exact edge of the widget and leaves without interacting with any other "widget pixel")? In the first case, it seems relatively straightforward to remove coordinates from on_mouse_leave events, as we are not trying to get coordinates but an "action" event (like on_click for example). |
Definitely not annoying! I appreciate the discussion. The way it works in the usual case is that when the GUI gets a mouse motion event, it works out which widgets are under the mouse and saves that information. The next time there's a mouse motion event, it does the same thing, and if it notices that there are any widgets that used to be under the mouse but aren't any more, it issues them an Having thought about this for a couple days now, I agree that the best solution is to remove the x,y coordinates from the |
When trying to remove a Mover from the gui, I get the following crash:
with this code
This doesn't happen with a Frame, for example, so I'm guessing it's a bug, but I couldn't pinpoint the origin. Or maybe I'm doing something wrong, but it's a relatively straightforward code.
The text was updated successfully, but these errors were encountered: