summaryrefslogtreecommitdiffstats
path: root/Mac/Demo/textedit
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/Demo/textedit')
-rw-r--r--Mac/Demo/textedit/ped.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/Mac/Demo/textedit/ped.py b/Mac/Demo/textedit/ped.py
index 524b92a..6a0f882 100644
--- a/Mac/Demo/textedit/ped.py
+++ b/Mac/Demo/textedit/ped.py
@@ -141,7 +141,10 @@ class TEWindow(ScrolledWindow):
def menu_cut(self):
self.ted.TESelView()
self.ted.TECut()
- Scrap.ZeroScrap()
+ if hasattr(Scrap, 'ZeroScrap'):
+ Scrap.ZeroScrap()
+ else:
+ Scrap.ClearCurrentScrap()
TE.TEToScrap()
self.updatescrollbars()
self.parent.updatemenubar()
@@ -149,7 +152,10 @@ class TEWindow(ScrolledWindow):
def menu_copy(self):
self.ted.TECopy()
- Scrap.ZeroScrap()
+ if hasattr(Scrap, 'ZeroScrap'):
+ Scrap.ZeroScrap()
+ else:
+ Scrap.ClearCurrentScrap()
TE.TEToScrap()
self.updatescrollbars()
self.parent.updatemenubar()
@@ -226,8 +232,13 @@ class Ped(Application):
if hasattr(Scrap, 'InfoScrap'):
on = (Scrap.InfoScrap()[0] <> 0)
else:
- # Not there yet on Carbon, simply always enable
- on = 1
+ flavors = Scrap.GetCurrentScrap().GetScrapFlavorInfoList()
+ for tp, info in flavors:
+ if tp == 'TEXT':
+ on = 1
+ break
+ else:
+ on = 0
if on <> self.pastegroup_on:
self.pasteitem.enable(on)
self.pastegroup_on = on