[[oktatas:programozás:python:wxpython_gui|< wxPython GUI]] ====== wxPython vágólap ====== * **Szerző:** Sallai András * Copyright (c) Sallai András, 2021 * Licenc: [[https://creativecommons.org/licenses/by-sa/4.0/|CC Attribution-Share Alike 4.0 International]] * Web: https://szit.hu ===== Másolás ===== def click_toclipboard_button(self, event): self.dataObj = wx.TextDataObject() self.dataObj.SetText(self.resultText.GetValue()) if wx.TheClipboard.Open(): wx.TheClipboard.SetData(self.dataObj) wx.TheClipboard.Close() else: wx.MessageBox("A vágólap nem nyitható meg!", "Hiba") ===== Beillesztés ===== def click_paste_button(self, event): success = False dataObj = wx.TextDataObject() if wx.TheClipboard.Open(): success = wx.TheClipboard.GetData(dataObj) wx.TheClipboard.Close() if success: self.resultText.SetValue(dataObj.GetText()) else: wx.MessageBox('Nincs adat a vágólapon', 'Error')