Login  Register

Re: Add menu item to Nautilus context menu on selected packages?

Posted by MartinW on Dec 02, 2013; 2:25pm
URL: https://forum.world.st/Add-menu-item-to-Nautilus-context-menu-on-selected-packages-tp4721406p4726709.html

I have one follow-up question trying to understand how this works:
I see that <nautilusXXXMenu> is used in AbstractNautilusUI to build the menus — but why is <contextMenu> here? Also the code seems to work all the same without <contextMenu>?

Martin.

Benjamin Van Ryseghem-2 wrote
Here is an example from Nautilus

AbstractNautilusUI class>>packagesMenu: aBuilder
        <contextMenu>
        <nautilusGlobalPackageMenu>
        | package target |
        target := aBuilder model.

        (package := target selectedPackage) ifNil: [ ^ target ].
       
        (aBuilder item: #'Browse scoped')
                keyText: 'b, s' if: Nautilus useOldStyleKeys not;
                action: [ target restrictedBrowsePackage ];
                order: 1000;
                help: 'Open a browser on a restricted view';
                withSeparatorAfter.