[Python] pyglet pushbutton on_mouse_release: how does one use it?

Discussão em 'Python' iniciado por Stack, Junho 6, 2025.

  1. Stack

    Stack Membro Participativo

    The docs for Pyglet Pushbutton state this:


    Blockquote Triggers the event ‘on_press’ when it is clicked by the mouse. Triggers the event ‘on_release’ when the mouse is released.
    ​

    however, it goes on to list a bunch of events, including on_mouse_release. Is there a way to use those other events with PushButton? if not, why are they listed there?

    The only way I've found to use on_mouse_release is to subclass PushButton, but that doesn't seem to line up with the documentation. I don't understand the use model for those other listed events. It feels like on_release and on_press belong in one category, and the other events in another.

    can anyone provide an example of on_mouse_release (or similar event) used with Pyglet Pushbutton?

    Continue reading...

Compartilhe esta Página