Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!sun-barr!rutgers!cbmvax!ken From: ken@cbmvax.commodore.com (Ken Farinsky - CATS) Newsgroups: comp.sys.amiga.programmer Subject: Re: Questions about dealing with the mouse. Message-ID: <22246@cbmvax.commodore.com> Date: 7 Jun 91 14:34:35 GMT References: Reply-To: ken@cbmvax.commodore.com (Ken Farinsky - CATS) Organization: Commodore, West Chester, PA Lines: 39 In article kenh@ersys.edmonton.ab.ca (Ken Huisman) writes: >what does the ReportMouse() function do? ReportMouse() turns mouse move events on or off for a window. You will get lots of mouse events while they are turned on, so process them very quickly. The program will only see them if it has MOUSEMOVE set in the IDCMP. Also, from the ReportMouse() autodoc: Also, it is still endorsed to simply set the WFLG_REPORTMOUSE flag bit in Window->Flags, or reset it, on your own. Make the operation an atomic assembly instruction (OR.W #WFLG_REPORTMOUSE,wd_Flags+2(A0) where A0 contains your window pointer). Most compilers will produce an atomic operation when faced with: Window->Flags |= WFLG_REPORTMOUSE; Window->Flags &=~WFLG_REPORTMOUSE; (NOTE: In V36, WFLG_REPORTMOUSE equals the old REPORTMOUSE.) >Using Aztec C 5.0e I get an undefined symbol error when it... don't know. >What I am trying to do is allow my program to highlight an area of >the screen by pressing the mouse button, dragging, and releasing >(this is a common operation done in many programs)... Two suggestions: 1. Use the FOLLOWMOUSE flag on a large gadget in the select area. This will let the program only hear mouse messages when the user drags the mouse after picking something in the select area. 2. Use INTUITICKS to do the same thing. If using INTUITICKS, wait for the gadget/mouse down event, update the display on each tick until the gadget/mouse up event is received. Update all of the information after the gadget/mouse up event. -- Ken Farinsky - CATS - Commodore Business Machines