home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.motif
- Path: sparky!uunet!news.mentorg.com!sbiederman
- From: steve_biederman@mentorg.com (Steve Biederman)
- Subject: Help with resizing window under mwm
- Sender: news@news.mentorg.com (News User)
- Message-ID: <1992Dec28.233729.29516@news.mentorg.com>
- Date: Mon, 28 Dec 1992 23:37:29 GMT
- Nntp-Posting-Host: slipknot.mentorg.com
- Organization: mentor
- Keywords:
- Followup-To:
- Lines: 27
-
- I'm a newcomer to X and to mwm. I want to programmatically resize my
- window. If I turn off mwm and simply run under X itself, a call to
- XMoveResizeWindow does the trick. Under mwm, I'm first calling XsetNormalHints
- and then XMoveResizeWindow. No dice. What am I doing wrong? My code fragment
- (slightly abstracted) follows.
-
-
- /* Desired x, y, width, and height are already known */
-
- display = XOpenDisplay(displayname);
- screen = DefaultScreen(display); root = RootWindow(display, screen);
-
- /* get which window the pointer is in */
- XQueryPointer(display, root, &dummywin, &this_win, &rootx, &rooty,
- &ptrx, &ptry, &modifs);
-
- /* tell the window manager where we'd like this to go */
- size_hints.x = x; size_hints.y = y;
- size_hints.width = width; size_hints.height = height;
- size_hints.flags = USPosition | USSize;
- XSetNormalHints(display, this_win, &size_hints);
-
- /* attempt to put it there */
- XMoveResizeWindow(display, this_win, x, y, width, height);
-
- XFlush(display);
-
-