I am having this error TypeError: could not convert 'SourceEditor' to 'Dialog, with new wxPython 4.2.0, when starting my app, RIDE. This is not happening in my current development environment (Fedora 36, Python 3.10.6 and wxPython 4.0.7).
The error happens in Windows and Linux (and probably in Mac) for this version wxPython 4.2.0.
Based on the comments in the RIDE issue, it sounds like this isn’t related to wxPython changes, but rather Python 3.10.
I’m a bit confused about what you’re trying to do with SourceEditor. It subclasses both wx.Panel and RIDEDialog, but also has an instance of a RIDEDialog? I can’t see a reason why you would want a class to subclass both wx.Panel and wx.Dialog at the same time, so that seems wrong.
About the use of both wx.Panel and wx.Dialog from my RIDEDialog, was to have access to variables/properties that are declared in another Dialog and stored in a file (style type .ini). My RIDEDialog class, can be called as a Dialog (with the colors and styles defined), or just as a provider for those settings. This was my solution to have a “dark mode”, or colors customization across the app.
The SourceEditor is a STC editor and added as a page on auibook, and originally (~2018) did not have this colors customization.
At the time I coded the feature, I found the need to declare as an implementation of RIDEDialog, but these days I should see if that is still needed, and the removal could be the solution for my problem.
A single widget can not be both a wx.Panel and a wx.Dialog. In other words, you can not inherit from more than one widget class. So you should remove RIDEDIalog from the SourceEditor list of parents.