On Mon, Mar 14, 2005 at 02:33:50AM +0100, kabutor wrote:
> Im just adding pudding to my app and I just encountered some nasty bug.
>
> Im doing rayquerys so when the query touches some points it paint a 3D
> model, its a map editor, I just add the buttons, and when I press a
> button, it gets the button event + the rayquery event, so it paints a
> model, and exec the button function, and I dont want that to happens, it
> supposed to capture the button event isnt it?
>
> Hope you understand :)
aha! i really couldnt see the problem with this for a while but the
on_click event is actually generated from the mouse button up event!
which is kinda normal for widgets sets as it lets the user click on a
button and then move the mouse off it with out triggering the click.
so two options:
1. change your code so that clicking operations happen on mouse button
up instead of mouse button down
2. subclass button and return True for all mouse button down events.
returning True signifies the event has been handled and should not sent
onto the user.