Don't call OpenDeskAcc() and AppendResMenu() on Carbon.
import Scrap
import os
import macfs
+import MACFS
import regsub
import string
import htmllib
try:
rf = Res.FSpOpenResFile(self.path, 3)
except Res.Error:
- Res.CreateResFile(self.path)
+ Res.FSpCreateResFile(self.path, '????', 'TEXT', MACFS.smAllScripts)
rf = Res.FSpOpenResFile(self.path, 3)
styles = Res.Resource('')
soup = Res.Resource('')
import Scrap
import os
import macfs
+import MACFS
UNDOLABELS = [ # Indexed by WEGetUndoInfo() value
None, "", "typing", "Cut", "Paste", "Clear", "Drag", "Style"]
try:
rf = Res.FSpOpenResFile(self.path, 3)
except Res.Error:
- Res.CreateResFile(self.path)
+ Res.FSpCreateResFile(self.path, '????', 'TEXT', MACFS.smAllScripts)
rf = Res.FSpOpenResFile(self.path, 3)
styles = Res.Resource('')
soup = Res.Resource('')
Menu.__init__(self, bar, "\024")
self.additem(abouttext, None, aboutcallback)
self.addseparator()
- self.menu.AppendResMenu('DRVR')
+ if MacOS.runtimemodel == 'ppc':
+ self.menu.AppendResMenu('DRVR')
def dispatch(self, id, item, window, event):
if item == 1:
Menu.dispatch(self, id, item, window, event)
- else:
+ elif MacOS.runtimemodel == 'ppc':
name = self.menu.GetMenuItemText(item)
OpenDeskAcc(name)
try:
output = Res.FSpOpenResFile(dest_fss, WRITE)
except MacOS.Error:
- Res.CreateResFile(destname)
+ Res.FSpCreateResFile(destname, '????', 'APPL', MACFS.smAllScripts)
output = Res.FSpOpenResFile(dest_fss, WRITE)
# Copy the resources from the target specific resource template, if any
-# Generated from 'Macintosh HD:SWDev:Metrowerks Codewarrior 6.0:Metrowerks CodeWarrior:MacOS Support:Universal:Interfaces:CIncludes:Menus.h'
+# Generated from "Sap:Programma's:Metrowerks CodeWarrior 6.0:Metrowerks CodeWarrior:MacOS Support:Universal:Interfaces:CIncludes:Menus.h"
def FOUR_CHAR_CODE(x): return x
noMark = 0
Menu.ClearMenuBar()
self.applemenu = applemenu = Menu.NewMenu(self.appleid, "\024")
applemenu.AppendMenu("%s;(-" % self.getaboutmenutext())
- applemenu.AppendResMenu('DRVR')
+ if MacOS.runtimemodel == 'ppc':
+ applemenu.AppendResMenu('DRVR')
applemenu.InsertMenu(0)
self.quitmenu = Menu.NewMenu(self.quitid, "File")
self.quitmenu.AppendMenu("Quit")
if id == self.appleid:
if item == 1:
EasyDialogs.Message(self.getabouttext())
- elif item > 1:
+ elif item > 1 and hasattr(Menu, 'OpenDeskAcc'):
name = self.applemenu.GetMenuItemText(item)
Menu.OpenDeskAcc(name)
elif id == self.quitid and item == 1:
-# Generated from 'Macintosh HD:SWDev:Metrowerks Codewarrior 6.0:Metrowerks CodeWarrior:MacOS Support:Universal:Interfaces:CIncludes:QuickDraw.h'
+# Generated from "Sap:Programma's:Metrowerks CodeWarrior 6.0:Metrowerks CodeWarrior:MacOS Support:Universal:Interfaces:CIncludes:QuickDraw.h"
def FOUR_CHAR_CODE(x): return x
kCursorComponentMove = 0x0008
kCursorComponentAnimate = 0x0009
kCursorComponentLastReserved = 0x0050
-# Generated from 'Macintosh HD:SWDev:Metrowerks Codewarrior 6.0:Metrowerks CodeWarrior:MacOS Support:Universal:Interfaces:CIncludes:QuickDrawText.h'
+# Generated from "Sap:Programma's:Metrowerks CodeWarrior 6.0:Metrowerks CodeWarrior:MacOS Support:Universal:Interfaces:CIncludes:QuickDrawText.h"
def FOUR_CHAR_CODE(x): return x
Menu.ClearMenuBar()
self.applemenu = applemenu = Menu.NewMenu(self.appleid, "\024")
applemenu.AppendMenu("All about echo...;(-")
- applemenu.AppendResMenu('DRVR')
applemenu.InsertMenu(0)
self.filemenu = Menu.NewMenu(self.fileid, 'File')
if id == self.appleid:
if item == 1:
mymessage("Echo -- echo AppleEvents")
- elif item > 1:
- name = self.applemenu.GetItem(item)
- Qd.OpenDeskAcc(name)
elif id == self.fileid:
if item == 1:
raise Quit
Menu.ClearMenuBar()
self.applemenu = applemenu = Menu.NewMenu(self.appleid, "\024")
applemenu.AppendMenu("All about echo...;(-")
- applemenu.AppendResMenu('DRVR')
applemenu.InsertMenu(0)
Menu.DrawMenuBar()
if id == self.appleid:
if item == 1:
mymessage("Echo -- echo AppleEvents")
- elif item > 1:
- name = self.applemenu.GetItem(item)
- Qd.OpenDeskAcc(name)
elif what <> autoKey:
print "Event:", (eventname(what), message, when, (h, v), modifiers)
## MacOS.HandleEvent(event)