[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] Multiple superclasses, same file

I haven't looked at that document in a while...wish I had when I started working this out. The sentence "In one given code file, you can only put classes that inherit from each Object, each other, and one external class" doesn't totally make sense to me. What is meant by "each Object"? There is only one Object class.

Could you (or someone else) commit a change to break out Common/GUI/ Base/SCSoundFileView.sc? SoundFileViewProgressWindow inherits from Object while SCSoundFileView inherits from SCScope, which I think is illegal (it is raising an error at least).


On Dec 10, 2006, at 1:43 AM, Dan Stowell wrote:

Yes, it's still the case, and it's in the "Writing classes" helpfile -
so in terms of documentation I think it's OK, although I can't speak
about the technical reasons for the restriction; I presume it's to
make it possible for the compiler to determine an order of


2006/12/10, Ryan Brown <ryan@xxxxxxxxx>:
I recently added a LOT of classes to my class library and I've ran
into some order of compilation problems. I am seeing a handful of
errors like:
ERROR: Cannot find superclass 'HJHObjectGui' for class 'MIDIRecGUI'
ERROR: Cannot find superclass 'ObjectGui' for class 'PeakMonitorGui'
ERROR: Cannot find superclass 'SCScope' for class 'SCSoundFileView'

The files where these classes are defined contain other classes with
different super classes. In 2003 there was a thread that discussed
this (included below), and the conclusion was that you needed to
break the classes out into multiple files. Is this still the case? If
so, the following files need to be changed:
        -SCSoundFileView.sc in the main distribution
-MIDISuite/MIDIRecGUI.sc, PeakMonitor/PeakMonitor.sc and MIDISuite/
SeqBuilder.sc in James's dewdrop lib
        -View/SCFreqScope.sc in Lance Putnam's library

And probably others that I don't have installed. Is it possible to
lift this restriction? At the least we should clearly document it...


> that's the same problem yes.
> its annoying because it means you can't put a class and its gui class
> onto the same file.
> I did just add the gui class ModelImplementsGuiBody which is now used
> for several light weight
> gui classes. then the model can simple implement guiBody and there is
> no need for a separate
> gui class.  if your gui class needs its own variables and more than
> one
> method, you can graduate
> it to a normal gui class.
> it doesn't ever matter what directory it is in, so no fears.
> james, is it the dual number / coarse-fine gui you were mentioning ?
> On Wednesday, July 2, 2003, at 02:35 PM, Alo Allik wrote:
> > I ran into a similar problem a few days ago and here's the response
> > from
> > cruxxial:
> >
> > "don't inherit from more than one superclass (other than Object)
> in a
> > given file.
> >
> > in other words, you could move your class to its own file and it
> would
> > work."
> >
> > and i must admit it did....not sure if this is relevant in your
> case...
> >
> > On Tue, 1 Jul 2003, James Harkins wrote:
> >
> >> I'm trying to subclass NumberEditorGui and it's telling me it can't
> >> find the superclass when compiling the class library. Where do I
> need
> >> to put my file so it will compile right? I don't want to put it
> in the
> >> crucial directory because then I'll lose it in my own stuff.
> >>
> >> Help!
> >>
> >> James
sc-dev mailing list

sc-dev mailing list