Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!purdue!decwrl!labrea!Portia!Jessica!duggie From: duggie@Jessica.stanford.edu (Doug Felt) Newsgroups: comp.sys.mac.programmer Subject: Re: CDEF's and Control Manager Summary: Why Bother? Message-ID: <3650@Portia.Stanford.EDU> Date: 13 Sep 88 23:30:38 GMT References: <8486@srcsip.UUCP> Sender: news@Portia.Stanford.EDU Reply-To: duggie@Jessica.stanford.edu (Doug Felt) Organization: Stanford University Lines: 34 After seeing the MacTutor article on CDEF's I decided to see if they were as big a hassle as they seemed. They were. I wrote a 'dial' with a needle that you can drag as the indicator, using LSC. To do the development I called the relevant routines directly, and then packaged the routines using the dispatch routine, then finally created a CODE resource and tested that. Conclusion? Since it was so much easier to use the original package of routines, there was no reason to bother making it a resource! The only reason I can see for writing your own CDEF is to replace one of the existing CDEF's with your own, in order to make cute hacks to other people's applications. In your own applications it is much easier to write a unit or unit-like piece of code to do the drawing and tracking yourself. In other applications just link with that unit. You still have the modularity, and you have the added benefit of knowing exactly what the code is doing. In my experience most of the code is in the CDEF anyway, and the ControlManager calls are easily duplicated. (I have the same feelings about the Dialog Manager... :-) (P.S. since there is no 'sloprect' etc for a needle that pivots, I didn't use those routines obviously designed just for the scrollbar. So I don't know why the original poster's code, which implemented these routines, was getting called the way it was.) If anyone wants the dial CDEF let me know and I will post it. Doug Felt Courseware Authoring Tools Project Sweet Hall 3rd Floor Stanford University Stanford, CA 94305 duggie@jessica.stanford.edu