Pluggable Menus

Andres Valloud sqrmax at cvtci.com.ar
Fri Mar 5 23:49:04 UTC 1999


Hi.

I've developed a TeX fileOut algorithm for filing out Smalltalk code in TeX
format. What I did to make access very easy was to add a line and then an item
in the browser's menues named TeX fileOut. But I didn't quite like it since I
was modifying the hardcoded menu. And yes, lately the menues were changed for
browsers and other windows, and my TeX fileOut line... say bye.

I think the 'browser plugin' concept would be useful for cases like this. Would
it be ok for me to reprogram the menus in the Browser to have a number of
menuItemLists instead of a bunch of hardcoded methods? I was thinking that the
Browser class would know about its instances methods, and keep track of the
added/deleted browser plugins added to it, mantaining the itemLists in class
variables.

For instance, the TeX fileOut changeset would just say something like:

Browser deleteAnyPrevious: #TeXFileOut. "Deletes previous versions"
Browser addPlugin: #TeXFileOut.

Browser forPlugin: #TeXFileOut addClassCategoryItem: 'TeX fileOut'
browserSelector: #classCategoryTeXFileOut:.

Browser forPlugin: #TeXFileOut addClassItem: 'TeX fileOut' browserSelector:
#classTexFileOut:.


And so for the methods.

What do you think?
Andres.





More information about the Squeak-dev mailing list