def __init__(self, parent):
"""Constructor"""
wx.Panel.__init__(self, parent=parent)
file_drop_target = MyFileDropTarget(self)
lbl = wx.StaticText(self, label="Drag some files here:")
self.fileTextCtrl = wx.TextCtrl(self, style=wx.TE_MULTILINE|wx.VSCROLL|wx.TE_READONLY)
"""Associates a drop target with this window. If the window already has a drop target, it is deleted."""
self.fileTextCtrl.SetDropTarget(file_drop_target)
"""add label and filetextctrl to boxsiser object with positioioning parameters"""
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(lbl, 0, wx.ALL, 5)
sizer.Add(self.fileTextCtrl, 1, wx.EXPAND|wx.ALL, 5)
self.SetSizer(sizer)
#----------------------------------------------------------------------
评论列表
文章目录