Files
Phoenix/docs/sphinx/rest_substitutions/snippets/python/converted/Clipboard.1.py
Andrea Gavana 87ef3295a7 Phoenix:
- Add the `DataObject` overview;
- Correct some missing link to the print dialog overview;
- Add converted snippets for wx.Sound, wx.DataObject and friends.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-17 20:56:11 +00:00

21 lines
627 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()