MC scripts (was: #initialize and MC)

Diego Fernandez diegof79 at gmail.com
Sun Sep 17 12:25:50 UTC 2006


I've the same problem with the autocategorizer...
I'm using #initialize but I think that the correct place should be
some "loading" method related to the package. (like
Application>>loaded in VAST).

I'm pretty new to MC, what is the correct way to do that.

In the Monticello Browser there is an "add postscript" but it doesn't
work, there is any way to fix that? Can I add those scripts "by hand"?

Regards,
Diego.-

PS: Damien, maybe you can refactor this in something like:
initialize
     (DPPreferenceInstaller for: self) value

So you can avoid a lot of copy&paste without subclassification

On 9/16/06, Damien Cassou <damien.cassou at laposte.net> wrote:
> Alejandro F. Reimondo a écrit :
> > Damien,
> > Please revise why you need to initialize the class...
>
> Each subclass sets a new preference in the preference browser.
>
> Current implementation is in the super class which is abstract:
>
> DPAbstract class>>initialize
>   self isAbstract
>     ifFalse:
>       [Preferences
>         addBooleanPreference: self preferenceName
>                     category: #'dynamic protocols'
>                      default: self defaultPreferenceValue
>                  balloonHelp: 'Activates the dymamic protocol ',
>                                 self name, '.'].
>
> DPAbstract class>>preferenceName
>   ^ self name copyFrom: 3 to: self name size
>
> The preference name is taken from the name of the class without the
> first two characters.
>
> Do you have another solution ?
>
>
> --
> Damien Cassou
>
>
>



More information about the Squeak-dev mailing list