I’m learning how to implement a Tree object. The code below works but I have a question about the line:
wx.Frame.__init__(self, parent=None, title='TreeCtrl Demo')
Is this line creating a Frame? The init is confusing me as I’ve not seen that syntax before.
Thank you…
import wx
class MainFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, parent=None, title='TreeCtrl Demo')
self.tree = wx.TreeCtrl(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize)
self.root = self.tree.AddRoot('Root ')
self.tree.AppendItem(self.root, 'Child')
self.tree.Expand(self.root)
self.Show()
if __name__ == '__main__':
app = wx.App(redirect=False)
frame = MainFrame()
app.MainLoop()