Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: TC4.0: Odd Address/Address Error, using SetCtlAction() Message-ID: <43281@apple.Apple.COM> Date: 23 Jul 90 19:08:05 GMT References: <10752@odin.corp.sgi.com> Organization: Apple Computer Inc, Cupertino, CA Lines: 32 In article <10752@odin.corp.sgi.com> myoung@joker.asd.sgi.com (Mark Young) writes: >I've been trying to implement a scrollbar in a dialog menu. Everything >seems to work Ok (the up/pageup/down/pagedown parts) until I try to move >the thumb widget. If I'm in the debugger, I get an odd address message >with the pc at 80157c (system 6.02). If I'm not in the debugger, macsbug >gives me an address error. > >when in the debugger, I can trace the action routine to the point where it >returns; the error happens as soon as I step past the return. > >If I don't set the action routine, I can move the thumb just fine, but can't >get set actions for the other parts of the scrollbar. > >anyone have any suggestions...please...I've already wasted many hours trying >to find a way to track this down with no luck. Are you using the same ActionProc for both the thumb and the arrows? If so, check out page i-324 of Inside Mac. There, it mentions that the ActionProc is called with a different number of parameters in either case, and that different routines need to be called depending on what was clicked on. Yes, this means that SetCtlAction is almost useless for scrollbars. The alternative is to pass in the pointer to the right routine when you call TrackControl. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions