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

Re: IDLgrLegend broken

I got Mark's message that covers it all after I wrote this one, but I
didn't want all that wrist effort for typing wasted :-)

Here is an explanation to this. In fact, this behavior is what you
expect to happen, although it is not what you really want.
IDLgrLegend is a subclass of IDLgrModel. When a saved instance of
IDLgrLegend is restored, the object class is re-created without
compiling IDLgrLegend_define, which contains all methods for IDLgrLegend
that are not inhereted from IDLgrModel. Then, the next time a method is
called on a Legend, only superclass' methods are considered, because
none specific for the subclass were ever compiled. And there are no such
things as GAP for setProperty method for IDLgrModel.
The workaround is to create a dummy IDLgrLegend object before restoring
the saved one, or to explicitly compile the needed file with all of the
(needed) methods.
The conclusion is, this will be true for any and all objects (especially
those that have superclasses). Save-restore is not going to (always)
give the results we want, unless we take special care.


P.S. Here, David, is the downside of keeping the methods in the same
file as object definition. But, if you made separate files for all
methods, you'd never find your way through all 5000 of them :-(