mirror of https://github.com/python/cpython.git
Added Help menu. Fixes #731635
This commit is contained in:
parent
68dcd34c0a
commit
31fa845c01
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue