Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6682709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:44:15+00:00 2026-05-26T04:44:15+00:00

I know that Python, unlike Java, supports inheritance. But does a user class can

  • 0

I know that Python, unlike Java, supports inheritance. But does a user class can inherits from several wxPython class without any problem ? (Does the wxPython design allows this ?)

Thank you in advance

I’m coding under Xubuntu 11.04 with wxPython 2.8 binding

P.S : This is my attempt.

#!/usr/bin/python
# -*- coding: iso-8859-15 -*-

import wx

class Square(wx.Panel, wx.Control):

    def __init__(self, parent):
        wx.Panel.__init__(self, parent, wx.ID_ANY, size=(60,60), pos=(80,50))
        wx.Control.__init__(self, parent)
        self.SetBackgroundColour(wx.Colour(0,0,255))

class MainFrame(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self, None, wx.ID_ANY, "Reactive square application",
            size = (300,200))
        panel = wx.Panel(self, wx.ID_ANY)
        square1 = Square(panel)
        square2 = Square(panel)
        square1.Bind(wx.EVT_BUTTON, self.OnSquareClick)

    def OnSquareClick(self, event):
        dialog = wx.MessageDialog(self, "You clicked on square !!!",
            "Hit has been done", wx.OK)
        dialog.Show(True)


if __name__ == "__main__":
    app = wx.PySimpleApp()
    frame = MainFrame()
    frame.Show(True)
    app.MainLoop()

And this is the stack trace :

swig/python detected a memory leak of type ‘wxControl *’, no destructor found.
Traceback (most recent call last):
File “/home/laurent/Documents/Programmation/Projets/Python/SourcesDeTest/ReactiveSquare.py”, line 31, in
frame = MainFrame()
File “/home/laurent/Documents/Programmation/Projets/Python/SourcesDeTest/ReactiveSquare.py”, line 19, in init
square1 = Square(panel)
File “/home/laurent/Documents/Programmation/Projets/Python/SourcesDeTest/ReactiveSquare.py”, line 10, in init
wx.Control.init(self, parent)
File “/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py”, line 11718, in init
self._setOORInfo(self)
File “/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py”, line 3887, in _setOORInfo
args[0].this.own(False)
File “/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py”, line 14606, in getattr
raise PyDeadObjectError(self.attrStr % self._name)
wx._core.PyDeadObjectError: The C++ part of the Square object has been deleted, attribute access no longer allowed.
Script terminated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:44:16+00:00Added an answer on May 26, 2026 at 4:44 am

    You don’t really want to do multiple inheritance with wxPython classes UNLESS they’re a normal wx class plus a mixin (see g.d.d.c’s answer). Or a wxPython class and a user-defined class. Otherwise, you will probably have issues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that Python, Ruby, Perl are all open source, but is Java really
I know that the MsNLB can be configured to user mulitcast with IGMP. However,
I'm writing a python library that has a per-user configuration file that can be
I know that for Python such solution exist already ( pypdf ). But I
I know that more-dynamic-than-Java languages, like Python and Ruby, often allow you to place
I know that Python doesn't support tail-call optimization. Does that mean a recursive procedure
I know that Tortoise HG (the windows explorer Mercurial plugin) uses Python internally, but
I know that ASM is basically the fastest one can get, but is what
I know that python has a len() function that is used to determine the
We know that Python provides a lot of productivity over any compiled languages. We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.