selitems.append(str(self.items[i]))
text = string.join(selitems, '\r')
if text:
- Scrap.ZeroScrap()
- Scrap.PutScrap('TEXT', text)
+ if hasattr(Scrap, 'PutScrap'):
+ Scrap.ZeroScrap()
+ Scrap.PutScrap('TEXT', text)
+ else:
+ Scrap.ClearCurrentScrap()
+ sc = Scrap.GetCurrentScrap()
+ sc.PutScrapFlavor('TEXT', 0, text)
def can_copy(self, *args):
return len(self.getselection()) <> 0
selbegin, selend = self.ted.WEGetSelection()
if selbegin == selend:
return
- Scrap.ZeroScrap()
+ if hasattr(Scrap, 'ZeroScrap'):
+ Scrap.ZeroScrap()
+ else:
+ Scrap.ClearCurrentScrap()
self.ted.WECopy()
self.updatescrollbars()
selbegin, selend = self.ted.WEGetSelection()
if selbegin == selend:
return
- Scrap.ZeroScrap()
+ if hasattr(Scrap, 'ZeroScrap'):
+ Scrap.ZeroScrap()
+ else:
+ Scrap.ClearCurrentScrap()
self.ted.WECut()
self.updatescrollbars()
self.selview()
"Can't find window or widget to insert text into; copy to clipboard instead?",
1) == 1:
from Carbon import Scrap
- Scrap.ZeroScrap()
- Scrap.PutScrap('TEXT', stuff)
+ if hasattr(Scrap, 'PutScrap'):
+ Scrap.ZeroScrap()
+ Scrap.PutScrap('TEXT', stuff)
+ else:
+ Scrap.ClearCurrentScrap()
+ sc = Scrap.GetCurrentScrap()
+ sc.PutScrapFlavor('TEXT', 0, stuff)
# not quite based on the same function in FrameWork