[wxPython] EVT_LEFT_UP doesn't work

I have a small program that makes a very small frame and a.o. reacts
to a mouse click. Now with wxpython 2.1.15 the mouse click is no
longer recognized. With older version it used to work.

The relevant code is:

        frame = wxFrame(None, -1, "You have mail",
                        wxPoint(max_x-width, 0),
                        size, wxSIMPLE_BORDER|wxSTAY_ON_TOP)
        wxStaticBitmap(frame, -1, png, wxPoint(0, 0), size )
        EVT_LEFT_UP(frame, self.OnClick)

Is this a bug?

···

--
Piet van Oostrum <piet@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: Piet.van.Oostrum@freeler.nl

I have a small program that makes a very small frame and a.o. reacts
to a mouse click. Now with wxpython 2.1.15 the mouse click is no
longer recognized. With older version it used to work.

The relevant code is:

        frame = wxFrame(None, -1, "You have mail",
                        wxPoint(max_x-width, 0),
                        size, wxSIMPLE_BORDER|wxSTAY_ON_TOP)
        wxStaticBitmap(frame, -1, png, wxPoint(0, 0), size )
        EVT_LEFT_UP(frame, self.OnClick)

Is this a bug?

My guess is that the wxStaticBitmap is getting the mouse event. Try hooking
yout event handler to it and see what happens.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxpython.org Java give you jitters?
http://wxpros.com Relax with wxPython!

"Robin Dunn" <robin@alldunn.com> (RD) writes:

I have a small program that makes a very small frame and a.o. reacts
to a mouse click. Now with wxpython 2.1.15 the mouse click is no
longer recognized. With older version it used to work.

The relevant code is:

frame = wxFrame(None, -1, "You have mail",
wxPoint(max_x-width, 0),
size, wxSIMPLE_BORDER|wxSTAY_ON_TOP)
wxStaticBitmap(frame, -1, png, wxPoint(0, 0), size )
EVT_LEFT_UP(frame, self.OnClick)

Is this a bug?

My guess is that the wxStaticBitmap is getting the mouse event.
Try hooking yout event handler to it and see what happens.

Yes, this solves it. Was this a recent change? I cannot find anything
in Changes.txt that explains this.

···

--
Piet van Oostrum <piet@cs.uu.nl>
URL: ICS | Utrecht University [PGP]
Private email: Piet.van.Oostrum@freeler.nl

<piet@cs.uu.nl> (P) writes:

Yes, this solves it. Was this a recent change? I cannot find anything
in Changes.txt that explains this.

Shouldn't events be passed on to the parent if the child doesn't handle it?
So I still think in this case when I attach it to the frame it should be
handles there if not handled by the bitmap. Is this a bug?

···

--
Piet van Oostrum <piet@cs.uu.nl>
URL: ICS | Utrecht University [PGP]
Private email: Piet.van.Oostrum@freeler.nl

>>>>> <piet@cs.uu.nl> (P) writes:

> Yes, this solves it. Was this a recent change? I cannot find anything
> in Changes.txt that explains this.

Shouldn't events be passed on to the parent if the child doesn't handle

it?

So I still think in this case when I attach it to the frame it should be
handles there if not handled by the bitmap. Is this a bug?

Events derived from wxCommandEvent (directly or indirectly) propogate up to
the parent if not handled, or if event.Skip() is called. All others do not,
(but they do propgate through a stack of event handlers that have been
pushed onto a window with PushEventHandler(), if any.) If it worked before
then it was a bug that has since been fixed in the C++ layers.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxpython.org Java give you jitters?
http://wxpros.com Relax with wxPython!