Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!mips!excelan!kinetics!mahboud From: mahboud@kinetics.com (Mahboud Zabetian) Newsgroups: comp.sys.mac.programmer Subject: Have you had problems with SetClikLoop? Message-ID: <921@excelan.COM> Date: 26 Dec 89 23:46:55 GMT Sender: news@excelan.COM Reply-To: mahboud@kinetics.com (Mahboud Zabetian) Organization: Novell, Inc., Walnut Creek - a.k.a Kinetics Lines: 51 Hi. Anybody out there ever try calling SetClikLoop twice consecutively for different TEHandles? I am doing so and it seems that the second call also changes the value of the clikLoop field of the first TE! Sound strange? This is what I do: SetClikLoop(OneClikLoop, globalFirstTE); DebugNum(OneClikLoop); DebugNum(TwoClikLoop); DebugNum((*globalFirstTE)->clikLoop); DebugNum((*globalSecondTE)->clikLoop); SetClikLoop(TwoClikLoop, globalSecondTE); DebugNum((*globalFirstTE)->clikLoop); DebugNum((*globalSecondTE)->clikLoop); (*globalFirstTE)->clikLoop = (ProcPtr) OneClikLoop; DebugNum((*globalFirstTE)->clikLoop); DebugNum((*globalSecondTE)->clikLoop); When I run this, the first four DebugNums return: 0x0020CF48 (in my heap) 0x0020CF58 (in my heap) 0x000CB16C 0x80011238 the second two DebugNums return: 0x000CB16C 0x000CB16C and the third two DebugNums return: 0x0020CF48 0x000CB16C When I look at the instructions at 0xCB16C, it seems they move a value from $14(A5) into A0 and then JSR to that location. The code, as it appears above(without the debugnums) works the way I want it, but if I remove the line: (*globalFirstTE)->clikLoop = (ProcPtr) OneClikLoop; Then the click loop executed for both TE's is the second ones, and the program does not work right. Anybody know what *exactly* is going on? Should I just not use SetClikLoop()? Thanx, -mahboud Standard Disclaimer: Don't mind me, I'm just babbling. ------------------------------------------------------------------------------ Mahboud Zabetian (415) 975-4511 mahboud@kinetics.com Kinetics/Excelan/Novell 1340 Treat Blvd, Suite 500 ...!ucbvax!mtxinu!kinetics!mahboud Walnut Creek, CA 94596