有人可以解释下面的代码。根据我的阅读, Myframe 继承了 wx.frame 但我不明白的是 init 方法中给出的以下几行,
super(MyFrame, self).__init__(parent, id, title,
pos, size, style, name)
代码
class MyFrame(wx.Frame):
def __init__(self, parent, id=wx.ID_ANY, title="",
pos=wx.DefaultPosition, size=wx.DefaultSize,
style=wx.DEFAULT_FRAME_STYLE,
name="MyFrame"):
super(MyFrame, self).__init__(parent, id, title,
pos, size, style, name)
# Attributes
self.panel = wx.Panel(self)
self.panel.SetBackgroundColour(wx.BLACK)
self.button = wx.Button(self.panel,
label="Push Me",
pos=(50, 50))