On Tue, Jul 21, 2009 at 8:49 AM, hari jayaram<har...@gmail.com> wrote:
> Hi I am trying to bind a mouse event to some StaticText objects. Basically I
> want contextual popups around some Static textobjects in my GUI
>
> Here is some test code ( see below), but somehow my events are going
> un-listened to.
>
> I have no clue why the event is not picked up . I am testing it on Linux .
You can try (self.text.Bind(...)) to see if it works (see
http://wiki.wxpython.org/self.Bind%20vs.%20self.button.Bind).
But IIRC on GTK (linux) the static text widget is not really its own
window, it is just drawn on its parent, so I am not sure if mouse
events will work with it or not.
Cody
> Can a non command event like wx.EVT_RIGHT_DOWN when caught by
> self.child.Bind() be skipped and passed on to the parent frame for
> whatever reason. I understood that the non command event if not caught
> by the child then does not propagate up. But if it is caught and then
> skipped can it then be propagated up.
No, Skip() just says to continue the normal event propagation, whatever
it would have been if the event binding did not exist. There is a way
to cause the event to propagate however, just call
event.ResumePropagation(1) in addition to Skip and that will tell the
event system to propagate the event up to the parent.
--
Robin Dunn
Software Craftsman
http://wxPython.org