Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b498de

Browse files
committed
Handle the apple menu differently under Carbon.
1 parent abd703d commit 6b498de

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Mac/Lib/FrameWork.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,10 +676,14 @@ class AppleMenu(Menu):
676676

677677
def __init__(self, bar, abouttext="About me...", aboutcallback=None):
678678
Menu.__init__(self, bar, "\024")
679-
self.additem(abouttext, None, aboutcallback)
680-
self.addseparator()
681679
if MacOS.runtimemodel == 'ppc':
680+
self.additem(abouttext, None, aboutcallback)
681+
self.addseparator()
682682
self.menu.AppendResMenu('DRVR')
683+
else:
684+
# Additem()'s tricks do not work for "apple" menu under Carbon
685+
self.menu.InsertMenuItem(abouttext, 0)
686+
self.items.append((abouttext, None, aboutcallback, None))
683687

684688
def dispatch(self, id, item, window, event):
685689
if item == 1:

0 commit comments

Comments
 (0)