Multiple inheritance samples?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Multiple inheritance samples?

braidedlogix
In the migration guide, there's a clear warning:

"The SIP tool currently does not support having more than one wrapped C++ class as the base classes of a Python class. In most cases this is not a problem because in wxPython you’re more likely to use multiple inheritance with simple mix-in classes or similar constructs than needing to inherit from more than one wx class.

However there is at least one use case where that can be a problem, and that is with the ComboCtrl’s wx.ComboPopup class. In wxWidgets and also in Classic wxPython you’re encouraged to use wx.ComboPopup as a mix-in class combined with the widget class that is going to be your popup window for the wx.ComboCtrl. This can not currently be done with Phoenix in the same way, but you can also use a widget class with a wx.ComboPopup in a has-a relationship rather than an is-a relationship. See samples/combo/combo1.py for an example."

For the sake of helping out myself and other highly-motivated morons, I would really appreciate if someone could post a few samples demonstrating this issue where:

1. The program worked in wxpython 2.8 but no longer works in 3 because of this issue
2. Possible alternative

I really don't know what to look for here, and I think having a contrast would be very helpful. The combo1.py sample works great, but I am not clear on why it shouldn't.

Many Thanks, Eric

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple inheritance samples?

Robin Dunn
Compare the ListCtrlComboPopup class in the ComboCtrl sample in the demo for Classic (https://github.com/wxWidgets/wxPython/blob/master/demo/ComboCtrl.py) with the same class name in Phoenix's sample (
https://github.com/wxWidgets/Phoenix/blob/master/samples/combo/combo1.py)

I noticed the other day that there is a mention of a new feature in sip that may allow multiple inheritance to work again, at least in some cases.  Investigating this is on my TODO list.

Robin


On Thursday, April 6, 2017 at 5:45:12 AM UTC-7, braidedlogix wrote:
In the migration guide, there's a clear warning:

"The SIP tool currently does not support having more than one wrapped C++ class as the base classes of a Python class. In most cases this is not a problem because in wxPython you’re more likely to use multiple inheritance with simple mix-in classes or similar constructs than needing to inherit from more than one wx class.

However there is at least one use case where that can be a problem, and that is with the ComboCtrl’s wx.ComboPopup class. In wxWidgets and also in Classic wxPython you’re encouraged to use wx.ComboPopup as a mix-in class combined with the widget class that is going to be your popup window for the wx.ComboCtrl. This can not currently be done with Phoenix in the same way, but you can also use a widget class with a wx.ComboPopup in a has-a relationship rather than an is-a relationship. See samples/combo/combo1.py for an example."

For the sake of helping out myself and other highly-motivated morons, I would really appreciate if someone could post a few samples demonstrating this issue where:

1. The program worked in wxpython 2.8 but no longer works in 3 because of this issue
2. Possible alternative

I really don't know what to look for here, and I think having a contrast would be very helpful. The combo1.py sample works great, but I am not clear on why it shouldn't.

Many Thanks, Eric

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple inheritance samples?

braidedlogix
Got it - will study thoroughly.

Many Thanks, Eric

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Multiple inheritance samples?

braidedlogix
It is too early to say if this actually the root problem of my ETS update woes, but after updating your old example directly, I get a segfault outcome. Even if multiple inheritance is not the exact cause, at least it gives me something to study directly (maybe shrink the size of my haystack a bit).

Again, many thanks for the assist.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...