Skip to content

Instantly share code, notes, and snippets.

@sbruchmann
Last active August 29, 2015 14:03
Show Gist options
  • Save sbruchmann/8067bf5cdad840835347 to your computer and use it in GitHub Desktop.
Save sbruchmann/8067bf5cdad840835347 to your computer and use it in GitHub Desktop.
Tutorial: Add a top-level menu entry at a specific position
define(function () {
"use strict";
var CommandManager = brackets.getModule("command/CommandManager"),
Commands = brackets.getModule("command/Commands"),
Menus = brackets.getModule("command/Menus");
var MY_COMMAND_ID = "PDFEXPORT";
function exportAsPDF() {
alert("Not implemented");
}
CommandManager.register("Export as PDF", MY_COMMAND_ID, exportAsPDF);
Menus
.getMenu(Menus.AppMenuBar.FILE_MENU)
.addMenuItem(
MY_COMMAND_ID, // Command id
null, // Keybindings
Menus.AFTER, // Position
Commands.FILE_SAVE_AS // Relative Command id
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment