Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!osf.org!al From: al@osf.org (Alastair Gourlay) Newsgroups: comp.windows.x.motif Subject: RE: How do you get xmArrowButton widgets to repeat? Message-ID: <9105191834.AA04710@pmin20> Date: 19 May 91 18:34:19 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 50 > I have several xmArrowButtonWidgetClass widgets that I use to scroll thru a > window. This works fine, but I have to press and release the mouse button > each time I wish to scroll down an entry. I would like to be able to HOLD > the button down and have the window scroll UNTIL I RELEASE the arrow. You might try the following (untested) code segment: /***********/ static XtIntervalId timer; ArrowButton XmNarmCallback: arm_cb(w,cd,cb) Widget w; XtPointer cd, cb; { timer = XtAppAddTimeOut(app, SCROLL_INTERVAL, timer_proc, w) } ArrowButton XmNdisarmCallback: disarm_cb(w,cd,cb) Widget w; XtPointer cd, cb; { XtRemoveTimeOut(t); } Scrolling code: timer_proc(w, t) Widget w; XtIntervalId t; { /* do scrolling for ArrowButton w */ timer = XtAppAddTimeOut(app, SCROLL_INTERVAL, timer_proc, w) } This should work :-) ..although you may want to put in an initial delay before the auto-scrolling starts. If you are opening multiple display connections, you should remove the global XtIntervalId, and keep track of it in the Arrowbutton XmNuserData resource.) Alastair Gourlay.