Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-spam!ames!ucbcad!ucbvax!decvax!decwrl!sun!cmcmanis From: cmcmanis@sun.UUCP Newsgroups: comp.sys.amiga Subject: Re: proportional gadgets Message-ID: <17434@sun.uucp> Date: Mon, 27-Apr-87 14:25:19 EDT Article-I.D.: sun.17434 Posted: Mon Apr 27 14:25:19 1987 Date-Received: Wed, 29-Apr-87 00:46:59 EDT References: <3294@jade.BERKELEY.EDU> Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 55 Summary: Set a Timer for repeat In article <3294@jade.BERKELEY.EDU>, (Randy Spencer) writes: > ... I am > working on that word processing project and I can't seem to figure > out how to let the user press in that area outside that gadgets knob > and have the mouse button repeat. I want to let the use scroll down > by pressing the mouse button down with the pointer near the bottom, > but now it only moves one window per click. > > If there are any ideas out there, please fill me in on them... > Randy Spencer P.O. Box 4542 Berkeley CA 94704 (415)284-4740 Randy and others, this is just an idea but it should work. If you are set to receive both MOUSEBUTTONS and MOUSEMOVE events then you could use the following senario ... When you get a BUTTON_DOWN in the prop gadget you will also get a new value for that gadget (it moves). Start a timerrequest asyncronously for 'n' micros. If you get a BUTTON_UP you AbortIO() the timer request, if the timer request completes (Sets a Sig_bit which your while loop is waiting on anyway) then internally diddle the propgadget and adjust it again. Then reset the timer. So in psuedo code it would look something Like ... [WINDOWSIG is a macro to get the signal bit from the user port) while (1) { Igot = Wait(WINDOWSIG(win) | 1< Class; /* get all of the useful stuff out of Msg */ ReplyMsg(Msg); /* Then reply to it */ switch (class) { case BUTTON_DOWN : set timer; case BUTTON_UP : abort timer; case MOUSE_MOVE : if (out of gadget) abort_timer; else ignore; .... and so on handling all of the messages ... } } else { /* else the timer kicked us */ diddle prop gadget; RefreshGadgets(win,propgadget,1); ... update window appropriately ... SendIO(timerrequest); /* kick off another timer request */ } } Note, I haven't tried this but I can't see anything obviously wrong with it. -- --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These views are my own and no one elses. They could be yours too, just call MrgCop() and then ReThinkDisplay()!