dqmelo@sdrc.UUCP (Asbjorn_melo) (02/21/90)
I'm posting again because I got no response the first time. This time I will be more specific. I'm writing a calculator in x11r3 on a DEC vaxstation 3100. I'm trying to find a way to resize the buttons on the calculator when the user resizes the main window of the calculator. Initially, I tried calling XConfigureWindow on the subwindows when I got a ConfigureNotify event on the parent. This resulted in the disappearance of the subwindows and no reappearance in the new location. Now I am trying a new approach. When a ConfigureNotify event is received on the parent, I call XDestroyWindow on the parent after querying the current location and size. The problem with this approach is that I am unable to query the location of the main window in my application. The XWindowAttributes structure stores -1, -1 for the x, y members anytime after the window is mapped. Therefore calls to XGetWindowAttributes or XGetWindowGeometry return -1, -1 for the location. Can anyone say how to get the correct location of a window; how to get XConfigureWindow to work; or a good way to get subwindows to resize along with their parent? Thanks, Mitch Horton uucp!sdrc!sphorton
rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (02/22/90)
Therefore calls to XGetWindowAttributes or XGetWindowGeometry return -1, -1 for the location. I'd say you're running under a reparenting window manager, and the coordinates are relative to the window manager's frame, not the root window. Can anyone say how to get the correct location of a window; Try XTranslateCoordinates. how to get XConfigureWindow to work; Should work as far as I know. or a good way to get subwindows to resize along with their parent? Try using a toolkit. :-)