How to use the @jupyterlab/mainmenu.MainMenu function in @jupyterlab/mainmenu

To help you get started, we’ve selected a few @jupyterlab/mainmenu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / packages / mainmenu-extension / src / index.ts View on Github external
activate: (app: JupyterLab, palette: ICommandPalette): IMainMenu => {
    let menu = new MainMenu(app.commands);
    menu.id = 'jp-MainMenu';

    let logo = new Widget();
    logo.addClass('jp-MainAreaPortraitIcon');
    logo.addClass('jp-JupyterIcon');
    logo.id = 'jp-MainLogo';

    let quitButton = PageConfig.getOption('quit_button');
    menu.fileMenu.quitEntry = quitButton === 'True';

    // Create the application menus.
    createEditMenu(app, menu.editMenu);
    createFileMenu(app, menu.fileMenu);
    createKernelMenu(app, menu.kernelMenu);
    createRunMenu(app, menu.runMenu);
    createSettingsMenu(app, menu.settingsMenu);
github jupyterlab / jupyterlab-data-explorer / packages / mainmenu-extension / src / index.ts View on Github external
activate: (
    app: JupyterFrontEnd,
    palette: ICommandPalette,
    router: IRouter,
    inspector: IInspector | null,
    labShell: ILabShell | null
  ): IMainMenu => {
    const { commands } = app;

    let menu = new MainMenu(commands);
    menu.id = 'jp-MainMenu';

    let logo = new Widget();
    logo.addClass('jp-MainAreaPortraitIcon');
    logo.addClass('jp-JupyterIcon');
    logo.id = 'jp-MainLogo';

    // Only add quit button if the back-end supports it by checking page config.
    let quitButton = PageConfig.getOption('quitButton');
    menu.fileMenu.quitEntry = quitButton === 'True';

    // Create the application menus.
    createEditMenu(app, menu.editMenu);
    createFileMenu(app, menu.fileMenu, router, inspector);
    createKernelMenu(app, menu.kernelMenu);
    createRunMenu(app, menu.runMenu);
github jupyterlab / jupyterlab / tests / test-mainmenu / src / mainmenu.spec.ts View on Github external
it('should construct a new main menu', () => {
        const menu = new MainMenu(new CommandRegistry());
        expect(menu).to.be.an.instanceof(MainMenu);
      });
    });
github jupyterlab / jupyterlab_app / src / browser / extensions / utils-extension / index.tsx View on Github external
function buildPhosphorMenu(app: ElectronJupyterLab): IMainMenu {
    let menu = new MainMenu(app.commands);
    let titleBar = buildTitleBar(app);

    menu.id = 'jpe-MainMenu-widget';
    titleBar.id = 'jpe-TitleBar-widget';

    titleBar.addClass('jpe-mod-' + app.info.uiState);

    let logo = new Widget();
    logo.addClass('jp-MainAreaPortraitIcon');
    logo.addClass('jpe-JupyterIcon');
    logo.id = 'jp-MainLogo';

    app.shell.addToTopArea(logo);

    app.shell.addToTopArea(menu);
    app.shell.addToTopArea(titleBar);

@jupyterlab/mainmenu

JupyterLab - Main Menu

BSD-3-Clause
Latest version published 4 days ago

Package Health Score

95 / 100
Full package analysis

Similar packages