Skip to content

Looks like on Mac wx.TheClipboard.IsSupported doesn't return correct value #2042

@tianzhuqiao

Description

@tianzhuqiao

Operating system: macOS 11.4
wxPython version & source: 4.1.1
Python version & source: 3.7.0
Description of the problem:

Looks like "wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT))" always return false even if it does has text in clipboard.

For example, first copy some text to clipboard; however the following code doesn't print anything

wx.TheClipboard.Open()
if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)):
    data = wx.TextDataObject()
    if wx.TheClipboard.GetData(data):
        print(data.GetText())
wx.TheClipboard.Close()

The following code print the text in clipboard correctly

wx.TheClipboard.Open()
data = wx.TextDataObject()
if wx.TheClipboard.GetData(data):
    print(data.GetText())
wx.TheClipboard.Close()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions