Added Help menu. Fixes #731635

This commit is contained in:
Jack Jansen 2003-05-27 14:10:37 +00:00
parent 68dcd34c0a
commit 31fa845c01
1 changed files with 20 additions and 0 deletions

View File

@ -110,11 +110,23 @@ def makeusermenus(self):
self.openwindowsmenu = Wapplication.Menu(self.menubar, 'Windows')
self.makeopenwindowsmenu()
self.makehelpmenu()
self._menustocheck = [closeitem,
undoitem, cutitem, copyitem, pasteitem,
selallitem,
runitem, homepageitem]
def makehelpmenu(self):
python_app = os.path.join(sys.prefix, 'Resources/Python.app')
help_source = os.path.join(python_app, 'Contents/Resources/English.lproj/Documentation')
hashelp = os.path.isdir(help_source)
self.helpmenu = m = self.gethelpmenu()
helpitem1 = FrameWork.MenuItem(m, "PackageManager Help", None, self.domenu_packmanhelp)
helpitem1.enable(hashelp)
helpitem2 = FrameWork.MenuItem(m, "MacPython Help", None, self.domenu_pythonhelp)
helpitem2.enable(hashelp)
def quitevent(self, theAppleEvent, theReply):
self._quit()
@ -198,6 +210,14 @@ def domenu_quit(self):
def domenu_save(self, *args):
print "Save"
def domenu_pythonhelp(self, *args):
from Carbon import AH
AH.AHGotoPage("MacPython Help", None, None)
def domenu_packmanhelp(self, *args):
from Carbon import AH
AH.AHGotoPage("MacPython Help", "packman.html", None)
def _quit(self):
## import PyConsole, PyEdit
for window in self._windows.values():