Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!yale!quasi-eli!cs.yale.edu!cs.yale.edu!bitting-douglas From: bitting-douglas@cs.yale.edu (Douglas Bitting) Newsgroups: comp.sys.mac.programmer Subject: Re: TCL limitations question (long but worth it)... Keywords: TCL, ThinkC, Color, OOP Message-ID: <1991Jun6.044553.2057@cs.yale.edu> Date: 6 Jun 91 04:45:53 GMT References: <1991Jun5.191451.26662@dartvax.dartmouth.edu> Sender: news@cs.yale.edu (Usenet News) Distribution: comp Organization: Yale University Computer Science Dept., New Haven, CT 06520-2158 Lines: 45 Originator: bitting@suned.CS.Yale.Edu Nntp-Posting-Host: zoo-gw.cs.yale.edu >[someone wrote some stuff about wanting to get color out of TCL] While I have never tackled the problem of getting color out of TCL, I do have some stuff to say about the name dependencies you think you are running into. Assume you have an object called MyObj, and a subclass of this call MyOtherObject. If you have a function that looks like this: void SomeFunction(MyObj *anObj) { anObj->AFunctionCall(some/no arguments); } You can still call this as SomeFunction (anOtherObject) where anOtherObject is a MyOtherObject. The appropriate functions of the MyOtherObject class will be called. *However,* this assumes that the function being called exists in the MyObj class. If this function (really, its a method) is overridden in the MyOtherObject class, the method from MyOtherObject will be the one that called. In other words, the only way that you will run into name dependency is if you have some methods in MyOtherObject which don't exist in MyObject that you wish to call. I hope that made sense... So, theorectically (and I don't really know because I haven't looked into it...) you should be able to do color by writing subclasses of the necessary things and overriding the functions which need to be overridden. The one thing you need to make sure of is that all objects which are created my new() are your subclasses (those that need to be your subclasses, that is). Yes, this would take some work, but I don't know that it requires re-writing the entire class library. I think it is a shame that Symantec didn't include color in its class library. However, perhaps they will put it in the mythical version 5.0. Anyway... perhaps I just restated what was said before... however, it is a lot clearer in my mind now... :-) --Doug -- Doug Bitting | "And we know that in all things God works PO Box 3043 Yale Station | for the good of those who love him..." New Haven, CT 06520 | --Romans 8:28 bitting@cs.yale.edu +------------------------------------------