Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!ico!auto-trol!marbru From: marbru@auto-trol.UUCP (Martin Brunecky) Newsgroups: comp.windows.x Subject: Re: How do I simulate Command button event? Keywords: XSendEvent, Command Message-ID: <818@auto-trol.UUCP> Date: 12 Sep 90 00:11:04 GMT References: <1990Sep11.095335@sarek.Berkeley.EDU> Reply-To: marbru@auto-trol.UUCP (Martin Brunecky) Organization: Auto-trol Technology, Denver Lines: 22 In article <1990Sep11.095335@sarek.Berkeley.EDU> mh2620@sarek.Berkeley.EDU (Mark Horstman [235-3417]) writes: >I'm trying to simulate a button press/release event in a Athena Command >widget but can't seem to get it to work. I'm using XSendEvent. Do I >have to fill the whole XButtonEvent structure? Do I have to send a >press event followed by a release event or can I just send the release >event? > You better do both, though for Xaw command I think you don't need to worry about x,y. If you don't send both press/release, something in the widget can get out of sync, especially since you can not manufacture the cative button grab normally activated by the server. Your problem may be the target window (I don't know what method you use to determine it, or may be some other field in the event structure. I am sending a pointer event to the current pointer position, looking for a window underneath the pointer, and it works fine. -- =*= Opinions presented here are solely of my own and not those of Auto-trol =*= Martin Brunecky marbru@auto-trol.COM (303) 252-2499 {...}ncar!ico!auto-trol!marbru Auto-trol Technology Corp. 12500 North Washington St., Denver, CO 80241-2404