Re: Event binding: change Python code; volunteer for C++
M A <[email protected]> Sun, 30 Jan 2022 16:53:02 -0500
| Newsgroups | gmane.comp.python.wxglade |
|---|---|
| Message-ID | <[email protected]> |
Sounds like a good idea. > On Jan 29, 2022, at 11:16 AM, Dietmar Schwertberger <[email protected]> wrote: > > Hi! > > I'm thinking about changing event binding code that is generated by wxGlade. > This is to fix issues like #507: https://github.com/wxGlade/wxGlade/issues/507 > The problem there is that non-command events like mouse events do not propagate to the surrounding container. > Also, in a future release I would like to add an easier way for the user to specify arbitrary events and so more non-command events will be used. > > In general, this requires to bind the event handler to the widget, not the surrounding frame. > E.g. current code: > > self.Bind(wx.EVT_BUTTON, self.on_button_event, self.button) > > > # this won't work as the event does not propagate: > > > self.Bind(wx.EVT_LEFT_DOWN, self.on_button_mouse_event, self.button) > > New code: > > self.button.Bind(wx.EVT_BUTTON, self.on_button_event) self.button.Bind(wx.EVT_LEFT_DOWN, self.on_button_mouse_event) > > Does anybody have objections? > For now I will only change this for Python. > I don't know whether Lisp would support the change. > For Perl it would probably work. If someone volunteers for testing, I will implement the change. > > For C++ at the moment still event tables are generated. It's time to change this, but again I need a volunteer. > > Regards, > > Dietmar > _______________________________________________ > wxGlade-general mailing list > wxGlade-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/wxglade-general