MacGapProject / MacGap1

Desktop WebKit wrapper for HTML/CSS/JS applications.
Other
3.55k stars 208 forks source link

Adding a menu #110

Closed ghost closed 10 years ago

ghost commented 10 years ago

I'm trying to add a root level menu, but it doesn't seem to work. Do I need to add my root level menu's in xcode interface builder instead?

I tried:

macgap.menu.addItem("Tools");

macgap.menu.getItem("Tools").addItem("Check For Updates", "", function() {

                                     checkForUpdates();
});
jeff-h commented 10 years ago

At this stage yes, you have to add the root level menu items manually in Xcode.

I'd really like something like macgap.menu.addItem("Tools"); to work, but it would also need some kind of position argument to determine where to put it, and to do that we probably need a getter to get the position of other existing items.

Pull requests gratefully received!