Hi,
I am building an overlay widget library for gl.canvas. At present there are simple ones, like panel, button, checkbox, slider etc.
The frame work is similar to any other gui kit and follows parent-child hierarchy.
I am implementing a simple event system. Here are the steps:
-
You bind an event directly to widget. For example : self.button.bind(“click”, myfunction)
-
When user click on canvas, canvas return the unique widget id and event type.
-
Start a search for this widget using id from the top level frame.
-
If widget found, find if this widget has registered an event of same type
-
If event matches then execute the function.
This is simple and so far working fine. I was reading these two articles earlier for some tips:
http://wiki.wxpython.org/EventPropagation
http://wiki.wxpython.org/self.Bind%20vs.%20self.button.Bind
My question is do I need event propagation? If yes, then why?
Is it possible that above logic will fail some where?
Cheers
Prashant