[Cuis-dev] How to extend BrowserWindow menus?

Juan Vuletich juan at cuis.st
Wed Jun 5 05:19:37 PDT 2024


Hi Mariano,

I'm doing a big overhaul of the way to specify Menus and Keyboard 
Shortcuts in Cuis. The objective is to make it more flexible and nicer 
to use than DynamicMenuBuilder. It is extensible by third parties, 
although this is not yet documented and there are not any examples. See 
#at:registerMenuAndShortcutsSpecProvider:, or give me another week or so 
until this stabilizes.

For a specific case where the implementor of the menu item action is 
neither the Window nor the Model, see the menu for the list of files in 
FileList. In any case, what I'd do perhaps is to extend the window menu 
with the new operations that require its state.

Cheers,

On 6/4/2024 5:05 PM, Mariano Montone via Cuis-dev wrote:
> After looking more deeply at the implementation of menus, etc, I think 
> my problem may be a bit difficult to solve.
>
> So perhaps it is better to forget about this, I've got it more or less 
> "solved" for my purposes.
>
> El 4/6/24 a las 12:30, Mariano Montone escribió:
>> Hello,
>>
>> I would like to extend BrowserWindow menus from my extension.
>>
>> I have code like this:
>>
>> MyExtension class>>systemCategoryMenuOptions
>>
>>     ^ {
>>             {
>>                 #itemGroup             ->         10.
>>                 #itemOrder             ->         10.
>>                 #label             ->         'search...'.
>>                 #object       ->         self.
>>                 #selector             -> #searchCategory:.
>>                 #icon             ->         #findIcon
>>             } asDictionary.
>>         }
>>
>> But I can't figure out how to access the Browser instance from the 
>> #searchCategory: method in my extension class. I have no way of 
>> passing it via #arguments: there either.
>>
>> It makes sense to be able to, as extensions will want to access the 
>> current browser state (selected category, etc). Is there a workaround 
>> for this?
>>
>> Also, if this is solvable, I will want to extend the class list menu 
>> of the browser too. But it doesn't use DynamicMenuBuilder anymore, it 
>> was dropped at some point. Could it be brought back?
>>
>> Thanks!
>>
>>     Mariano
>>


-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich



More information about the Cuis-dev mailing list