Path: utzoo!attcan!uunet!snorkelwacker!usc!elroy.jpl.nasa.gov!ames!dftsrv!etac632!joe From: joe@etac632 (Joe Fulson-Woytek) Newsgroups: comp.windows.x Subject: Getting window position Keywords: XTranslateCoordinates , root window, window position. Message-ID: <2973@dftsrv.gsfc.nasa.gov> Date: 2 Aug 90 13:07:02 GMT References: <532@creatures.cs.vt.edu> Sender: news@dftsrv.gsfc.nasa.gov Reply-To: joe@etac632.gsfc.nasa.gov (Joe Fulson-Woytek) Distribution: na Organization: NSESCC, Goddard Space Flight Center, Greenbelt MD Lines: 21 In article <532@creatures.cs.vt.edu> ramakris@bloss.cs.vt.edu (S.Ramakrishnan) writes: ; ; ; Getting the window position ; I assume that you need the position of the top left of thw window with ; respect to the root window coordinates. ; Why not try this simple method : ; ; int pos_x, pos_y ; ; ; XTranslateCoordinates(display , window , root_w , 0 , 0 , &pos_x , pos_y ); ; ; where display = the current display of the window. ; window = the window in question. ; ( 0 , 0 ) == coordinates of the top left of the window. OOps. I had justed posted a response to a previous suggestion to try XTranslateCoordinate by saying it didn't work. When I saw this second posting suggesting the same thing, I decided to recheck my code. I discovered I had set the "window" argument wrong, and now XTranslateCoordinate works as advertised. Thanks. Joe Fulson-Woytek