Gary Hubbard wrote:
I have been using wxPython for a number of years, and am basically very happy, but I continually troubled by not having an acceptable doc/view architecture.
The existing code, which I can't tell if it is being actively used or maintained, requires an explicit ProcessEvent method, with a long switch table. This seems like a huge kludge to me. Enough so, that I have never really learned or used it. It is neither Pythonic or C++'onic as far as I am concerned.
Have you looked at the wx.lib.pydocview module? wx.lib.docview is intended to be as close as possible to the C++ DocView framework, but be implemented totally in Python. The wx.lib.pydocview is supposed to streamline that somewhat to fit better with Python. Personally I haven't used either of them very much so I can't really say how well it accomplishes that goal.
Apparently, this is done because wxPython does not have a virtual ProcessEvent function. I don't really understand this, as the function is referred to as being virtual on the C++ side,
Just being C++ virtual is not enough: OverridingMethods - wxPyWiki
but I accept the statement as being true. I have not dug throught he C++ code sufficiently to figure out why.
My question is if the same thing could be accomplished by using PushEventHandler(), effectively adding another event handling layer between each existing layer.
Only if you can do it by using Events and Bind on the pushed event handlers. I expect that wouldn't be very pretty though. On the other hand, just a few days ago I added a wx.PyEventHandler class that allows you to override ProcessEvent, so it would probably be better to wait for the next release and then refactor docview.py to use that instead.
ยทยทยท
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!