Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ukma!hsdndev!dartvax!eleazar.dartmouth.edu!watt From: watt@eleazar.dartmouth.edu (Gill Watt) Newsgroups: comp.sys.mac.programmer Subject: TCL limitations question (long but worth it)... Summary: see subj Keywords: TCL, ThinkC, Color, OOP Message-ID: <1991Jun5.191451.26662@dartvax.dartmouth.edu> Date: 5 Jun 91 19:14:51 GMT Sender: news@dartvax.dartmouth.edu (The News Manager) Distribution: comp Organization: Dartmouth College, Hanover, NH Lines: 71 howdy, The Situation: I am currently facing a tough decision concerning the use of the Think Class Libraries and am looking for opinions. I would like to use the Think Class Libraries to write my application which does: Data display (in color) Dialog boxes for display parameter selection Text display of character sequences (<32K) Control for a NuBus card. The First Problem (no colors): The problem I have encountered is that the TCL windows and whatnot are all defined based on the WindowPtr. For my application I need to use the full palette of colors and therefore the CWindowPtr. I originally thought it would be as simple as creating my own subclass of CWindow (called CCWindow) that uses GetNewCWindow() in its initialization instead of GetNewWindow(). The Resulting Problem (CWindow name dependency): However, I discovered, much to my dismay, that windows are assumed to be CWindows in many separate parts of the Class Libraries. For instance, CDirector->itsWindow is defined as a CWindow. Foolishly thinking that this was the only conflict, I created my own versions of CDirector and CDocument that use CCWindows instead of CWindows. I named these CCDocument and CCDirector. The Problem Blossoms (Name dependencies everywhere): Unfortunately, the interdependencies run much deeper, as I discovered that CPrinter->IPrinter() requires a CDocument argument and won't accept one of these new-fangled CCDocument things. Enough of this. The crux of the matter is this. The TCL cannot easily be converted to use CWindowPtrs as well as WindowPtrs and I am left pondering my next step. 1. Should I persevere and effectively create an entire parallel Class Library that is, for all intents and purposes, identical to the Think Class Libraries, except for the fact that the CCWindow Class uses CWindowPtrs? 2. Should I take the shortcut and just edit the existing CWindow Class to use CWindowPtrs and the other classes will never know the difference? (I tried this before, but am a little wary after witnessing the effect of those modifications on the AutoWeave updater.) 3. Should I just abandon the Class Libraries and tackle the programming head on, using straight C code? Opinions welcome. (If they weren't would I have posted to the net??) -Gill -- --------------------------------------------------------------------- Gill Watt (watt@eleazar.dartmouth.edu) Thayer School of Engineering, Dartmouth College, Hanover, NH 03755 ---------------------------------------------------------------------