Defining a new command

Damien Cassou damien.cassou at gmail.com
Tue Apr 24 09:17:29 UTC 2007


2007/4/24, David Röthlisberger <squeak at c3com.ch>:
> Hi Alex,
>
> > I just defined a new command for Omnibrowser, however, how can I make it
> > appear on the method menu list ?
> > There should be a magic invocation i guess :-)
>
> You must add a method starting with 'cmd' to class OBCodeBrowser and place it in the
> method protocol 'commands'. This method answers the class of your new command.
> Every method following this convention is executed at start up of a browser and every
> returned command is collected in the list of available commands for this browser.

Putting the method in the 'commands' protocol is not required to let
developers write class extensions. The method can return a collection
of classes instead of just one if it fits your need.


-- 
Damien Cassou


More information about the Squeak-dev mailing list