Topic klingt ganz simpel, ist es aber für mich nicht.
Erklärung:
Ich habe ein Panel was in einem Frame liegt. Dort sind allerlei Dinge
enthalten. Buttons, Eingabefelder etc..
Code: Alles auswählen
class ConvertGui(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'Convert', (350,400), (460, 100), style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX)
self.panel = wx.Panel(self, -1)
was fast komplett mit einer Listbox befüllt ist. Ich dachte, man könnte das ganze in eine neue Klasse stecken, doch da ich nicht so der Fachmann in der Beziehung bin, sind meine Versuche bis jetzt völlig gescheitert

Hier mal mein Ansatz:
Code: Alles auswählen
#Wir befinden uns in der Datei gui.py
#Durch Button Klick wird diese Methode aufgerufen
import gui2
def checkExtras(self):
gui = gui2.Uff()
#Datei gui2
import gui, wx
class Uff(wx.Frame, gui):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'List', (350,400), (300, 200), style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX)
self.panel = wx.Panel(self, -1)
self.list = wx.ListBox(panel, -1)

Hier mal die Letzte:
Code: Alles auswählen
Traceback (most recent call last):
File "C:\test\python\diamant\gui.py", line 4, in ?
import wx, os, os.path, FileConvert, gui2
File "C:\test\python\diamant\gui2.py", line 3, in ?
class Uff(wx.Frame, gui):
TypeError: Error when calling the metaclass bases
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

Gruss prosta