Files
Phoenix/docs/sphinx/rest_substitutions/snippets/python/converted/wx.Clipboard.1.py
2016-05-18 16:38:18 -07:00

21 lines
607 B
Python

# Write some text to the clipboard
if wx.TheClipboard.Open():
# This data objects are held by the clipboard,
# so do not delete them in the app.
wx.TheClipboard.SetData(wx.TextDataObject("Some text"))
wx.TheClipboard.Close()
# Read some text
if wx.TheClipboard.Open():
if wx.TheClipboard.IsSupported(wx.DF_TEXT):
data = wx.TextDataObject()
wx.TheClipboard.GetData(data)
wx.MessageBox(data.GetText())
wx.TheClipboard.Close()