def onCopyAndFlush(self, event):
"""
Copy to the clipboard and close the application
"""
self.dataObj = wx.TextDataObject()
self.dataObj.SetText(self.text.GetValue())
if wx.TheClipboard.Open():
wx.TheClipboard.SetData(self.dataObj)
wx.TheClipboard.Flush()
else:
wx.MessageBox("Unable to open the clipboard", "Error")
self.GetParent().Close()
评论列表
文章目录