[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-dev] move Model to Core?
On Sun, Nov 23, 2003 at 07:52:56PM -0800, Ioannis Zannos wrote:
> The Main customizing question that Stefan mentions is indeed
> a central one. The need to deviate from the default Main
> will come up with very high probability in the work of most
> users at some stage. I just overwrite several methods of
> Main in my own library - so I don't have to remove the Main.sc
> file, but I have to put up with the warnings of overwriting
> methods in the message window on compiling. (SK: same?)
yep.
> I'd say ways have to be devised to enable customization of
> Main methods without overwriting them. Stefan's idea seems
> good to me:
>
> Any user class (Say for example hypothetical "X_MIDI" class)
> can in it's *initClass method write in some globally accessible
> slots, functions that contain custom startUp, shutDown, or other
> Main method behaviors. Main methods will use these entries
> to do the customization. That is, if you want to customize the
> shutDown actions, you write in those slots at *initClass time.
> The fastest and simplest way to do that is to declare the
> slots as writable class variables of Main:
>
> Main {
> classvar <>startUp;
> classvar <>shutDown;
> classvar <>guiWindow;
> // etc. ...
>
> }
i like this, because it doesn't require new primitives and runtime
checks. i guess the key requirement is a consistent library directory
structure that makes it possible to exclude whole subsystems in the
library configuration (on linux).
right now i have to include Common/GUI/ because of Model.sc, but have
to exclude Document.sc and PlusGUI/. i have to exclude HIDServices
separately or customize Main not to call the initialization method.
<sk>