How to use @jupyterlab/mainmenu - 10 common examples

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 / tests / test-mainmenu / src / labmenu.spec.ts View on Github external
it('should accept useSeparators as an option', () => {
        const menu1 = new JupyterLabMenu({ commands }, false);
        const menu2 = new JupyterLabMenu({ commands }, true);
        menu1.addGroup([{ command: 'run1' }, { command: 'run2' }]);
        menu2.addGroup([{ command: 'run1' }, { command: 'run2' }]);

        expect(menu1.menu.items.length).to.equal(2);
        expect(menu2.menu.items.length).to.equal(4);
      });
    });
github jupyterlab / jupyterlab / tests / test-mainmenu / src / labmenu.spec.ts View on Github external
it('should accept useSeparators as an option', () => {
        const menu1 = new JupyterLabMenu({ commands }, false);
        const menu2 = new JupyterLabMenu({ commands }, true);
        menu1.addGroup([{ command: 'run1' }, { command: 'run2' }]);
        menu2.addGroup([{ command: 'run1' }, { command: 'run2' }]);

        expect(menu1.menu.items.length).to.equal(2);
        expect(menu2.menu.items.length).to.equal(4);
      });
    });
github jupyterlab / jupyterlab / tests / test-mainmenu / src / labmenu.spec.ts View on Github external
beforeEach(() => {
      menu = new JupyterLabMenu({ commands });
    });
github jupyterlab / jupyterlab / tests / test-mainmenu / src / edit.spec.ts View on Github external
beforeEach(() => {
      wodget = new Wodget();
      menu = new EditMenu({ commands });
      tracker = new WidgetTracker({ namespace: 'wodget' });
      void tracker.add(wodget);
    });
github jupyterlab / jupyterlab-data-explorer / tests / test-mainmenu / src / edit.spec.ts View on Github external
beforeEach(() => {
      wodget = new Wodget();
      menu = new EditMenu({ commands });
      tracker = new InstanceTracker({ namespace: 'wodget' });
      void tracker.add(wodget);
    });
github jupyterlab / jupyterlab-data-explorer / tests / test-mainmenu / src / file.spec.ts View on Github external
beforeEach(() => {
      wodget = new Wodget();
      menu = new FileMenu({ commands });
      tracker = new InstanceTracker({ namespace: 'wodget' });
      void tracker.add(wodget);
    });

@jupyterlab/mainmenu

JupyterLab - Main Menu

BSD-3-Clause
Latest version published 6 days ago

Package Health Score

95 / 100
Full package analysis

Similar packages