879 event.Veto() |
879 event.Veto() |
880 |
880 |
881 |
881 |
882 def GetCopyBuffer(self, primary_selection=False): |
882 def GetCopyBuffer(self, primary_selection=False): |
883 data = None |
883 data = None |
884 if primary_selection: |
884 if primary_selection and wx.Platform == '__WXMSW__': |
885 if wx.Platform != '__WXMSW__': |
885 return data |
886 wx.TheClipboard.UsePrimarySelection(primary_selection) |
886 else: |
887 else: |
887 wx.TheClipboard.UsePrimarySelection(primary_selection) |
888 return data |
|
889 if wx.TheClipboard.Open(): |
888 if wx.TheClipboard.Open(): |
890 dataobj = wx.TextDataObject() |
889 dataobj = wx.TextDataObject() |
891 if wx.TheClipboard.GetData(dataobj): |
890 if wx.TheClipboard.GetData(dataobj): |
892 data = dataobj.GetText() |
891 data = dataobj.GetText() |
893 wx.TheClipboard.Close() |
892 wx.TheClipboard.Close() |
894 return data |
893 return data |
895 |
894 |
896 def SetCopyBuffer(self, text, primary_selection=False): |
895 def SetCopyBuffer(self, text, primary_selection=False): |
897 if primary_selection: |
896 if primary_selection and wx.Platform == '__WXMSW__': |
898 if wx.Platform != '__WXMSW__': |
897 return |
899 wx.TheClipboard.UsePrimarySelection(primary_selection) |
898 else: |
900 else: |
899 wx.TheClipboard.UsePrimarySelection(primary_selection) |
901 return |
|
902 if wx.TheClipboard.Open(): |
900 if wx.TheClipboard.Open(): |
903 data = wx.TextDataObject() |
901 data = wx.TextDataObject() |
904 data.SetText(text) |
902 data.SetText(text) |
905 wx.TheClipboard.SetData(data) |
903 wx.TheClipboard.SetData(data) |
906 wx.TheClipboard.Flush() |
904 wx.TheClipboard.Flush() |