Event binding: change Python code; volunteer for C++

Dietmar Schwertberger <[email protected]> Sat, 29 Jan 2022 17:16:36 +0100
Newsgroups gmane.comp.python.wxglade
Message-ID <[email protected]>
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