Add Native.resetMainMenu and call it in global afterEach

This method removes any AtomMenuItems that aren't marked as 'global'. It ignores menu items that aren't instances of our custom subclass. This is needed by specs to clear any menu items added during tests. It will also be needed when a window loses focus and we want to remove any non-global menus associated with the window.
This commit is contained in:
Nathan Sobo
2011-12-23 12:43:32 -06:00
parent 09510f60a6
commit ae4fdf8812
8 changed files with 126 additions and 6 deletions

View File

@@ -39,3 +39,7 @@ class Native
pb = OSX.NSPasteboard.generalPasteboard
pb.declareTypes_owner [OSX.NSStringPboardType], null
pb.setString_forType text, OSX.NSStringPboardType
resetMainMenu: (menu) ->
OSX.NSApp.resetMainMenu