Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cbmvax!peter From: peter@cbmvax.commodore.com (Peter Cherna) Newsgroups: comp.sys.amiga.programmer Subject: Re: Prop gadgets and FOLLOWMOUSE Message-ID: <18813@cbmvax.commodore.com> Date: 11 Feb 91 17:23:27 GMT References: <1991Feb8.213305.15745@ssd.kodak.com> Reply-To: peter@cbmvax.commodore.com (Peter Cherna) Distribution: usa Organization: Commodore, West Chester, PA Lines: 27 In article <1991Feb8.213305.15745@ssd.kodak.com> hoffmann@acl.kodak.com (marty hoffmann) writes: >If I want to update screen information (like a counter) while the user >slides a proportional gadget, I create the gadget with GADGIMMEDIATE >and RELVERIFY. When I get a GADGETDOWN message for the gadget, I >enter a tight loop, reading the pot values directly from the PropInfo >structure and updating the screen accordingly. Aaaak. Why do you use a tight loop? That's equivalent to busy waiting, which is bad in a multitasking environment. You should use FOLLOWMOUSE and wait for MOUSEMOVE events. Only update your view of the world when you get MOUSEMOVEs. Some people refresh every INTUITICK instead of using MOUSEMOVE, but I recommend MOUSEMOVE. Here's an additional tip: if your prop gadget represents a number (say) from 1 to 10, then you'll get several MOUSEMOVEs for each level. Make sure the level actually changes before refreshing whatever changes (eg. a list moves). > Marty Hoffmann Peter -- Peter Cherna, Software Engineer, Commodore-Amiga, Inc. {uunet|rutgers}!cbmvax!peter peter@cbmvax.commodore.com My opinions do not necessarily represent the opinions of my employer. "Oh, PIN-compatible! I thought you wanted me to make it IN-compatible!"