summaryrefslogtreecommitdiffstats
path: root/Mac/Tools
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-12-31 14:53:05 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-12-31 14:53:05 (GMT)
commitad8381a8f008ed104c84cd59a14f4161083d60da (patch)
tree91d17ef27f38aa10bab9785b7fff3a45af376175 /Mac/Tools
parent420ed40344768adac305a6ff76baced021d6fffd (diff)
downloadcpython-ad8381a8f008ed104c84cd59a14f4161083d60da.zip
cpython-ad8381a8f008ed104c84cd59a14f4161083d60da.tar.gz
cpython-ad8381a8f008ed104c84cd59a14f4161083d60da.tar.bz2
Use the Carbon scrap manager interface if the old interface isn't available.
Diffstat (limited to 'Mac/Tools')
-rw-r--r--Mac/Tools/IDE/Wlists.py9
-rw-r--r--Mac/Tools/IDE/Wtext.py10
-rw-r--r--Mac/Tools/IDE/Wwindows.py9
3 files changed, 22 insertions, 6 deletions
diff --git a/Mac/Tools/IDE/Wlists.py b/Mac/Tools/IDE/Wlists.py
index 14edeb8..57e8924 100644
--- a/Mac/Tools/IDE/Wlists.py
+++ b/Mac/Tools/IDE/Wlists.py
@@ -176,8 +176,13 @@ class List(Wbase.SelectableWidget):
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
diff --git a/Mac/Tools/IDE/Wtext.py b/Mac/Tools/IDE/Wtext.py
index e21926d..86c79c3 100644
--- a/Mac/Tools/IDE/Wtext.py
+++ b/Mac/Tools/IDE/Wtext.py
@@ -430,7 +430,10 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
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()
@@ -438,7 +441,10 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
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()
diff --git a/Mac/Tools/IDE/Wwindows.py b/Mac/Tools/IDE/Wwindows.py
index 1494187..20ed312 100644
--- a/Mac/Tools/IDE/Wwindows.py
+++ b/Mac/Tools/IDE/Wwindows.py
@@ -564,8 +564,13 @@ def FrontWindowInsert(stuff):
"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