The problem which alerted me to this issue was a crash when I exit the app.
the rport:
Traceback (most recent call last):
File "d:\pkg\python\wxFB\wxPython\wpMeta\wpMetaBase.py", line 170, in m_splitter2OnIdle
self.m_splitter2.SetSashPosition( 0 )
RuntimeError: wrapped C/C++ object of type SplitterWindow has been deleted
is repeated 5 times when the app exits.
However, meanwhile I have run more tests and it looks like the call to unbind never disconnects the handler.
When I monitor the code’s executing in VSCode, the handler gets called over and over, not just the first time it is invoked.
As well I have meanwhile found another very similar question on stackoverflow: event handling - wxPython Unbind method returns True but doesn't Unbind - Stack Overflow
Do you have a minimal, but complete example that reproduces the problem? I fixed one issue fairly recently involving binding/unbinding events in a different order:
Yes, I have a small example along with its requirements.txt, but cannot upload because I am too new here.
The example is nothing but a frame with a splitter (sash gravity set to something low, like .2) and two text ctrls , each in its own plain box sizer. Because the base code is created by wxFB, it includes the OnIdle handler I have posted.
What happens, even without a debugger: I can resize the windows either by dragging the splitter sash or by resizing the whole frame. When I stop the resizing and release the mouse button, the splitter sash snaps back to the old position, with the sash splitting things equally for both sides.
FWIW, I’ll include the contents of the requirements:
certifi==2021.10.8
distlib==0.3.4
filelock==3.6.0
greenlet==1.1.2
numpy==1.22.2
ObjectListView==1.3.1
Pillow==9.0.1
pipenv==2022.1.8
platformdirs==2.5.1
pubsub==0.1.2
pyexiv2==2.7.1
Pypubsub==4.0.3
six==1.16.0
SQLAlchemy==1.4.31
virtualenv==20.13.1
virtualenv-clone==0.5.7
wxPython==4.1.1