Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!asuvax!ncar!ico!auto-trol!marbru From: marbru@auto-trol.UUCP (Martin Brunecky) Newsgroups: comp.windows.x Subject: Re: updating widget state after a wm move Message-ID: <721@auto-trol.UUCP> Date: 5 Feb 90 20:55:55 GMT References: <14274@cs.yale.edu> Reply-To: marbru@auto-trol.UUCP (Martin Brunecky) Organization: Auto-trol Technology, Denver Lines: 29 In article <14274@cs.yale.edu> omtzigt-theo@CS.Yale.EDU (theo omtzigt) writes: > >This must be a very simple question for anyone who has programmed up >any user interface, but I am kind of stuck. This is the problem; >I define a form widget that contains command buttons. The functionality >of the buttons is to pop down a menu through the call back routines. >To be able to pull down the menu at the right place, I am querying >the x and y position of both the form and the relative position of >the button. However, the state of the widget that I get back >through XtGetValues, is the position of the widget at realization, > ...... Depending on the window manager and/or vendorShell, you either get the "right" behavior or thr "wrong" behavior. I'v seen several window managers that do not bother to send configuration events to the window they moved. The simplest solution is using XTranslateCoordinates instead of XtTranslateCoords. You pay a roundtrip delay... so my code uses #ifdef and on machines with guaranteed window manager (such as DEC for this case) use faster XtTranslate... -- =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* 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