home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / motif / 8238 < prev    next >
Encoding:
Text File  |  1992-12-29  |  1.5 KB  |  41 lines

  1. Newsgroups: comp.windows.x.motif
  2. Path: sparky!uunet!news.mentorg.com!sbiederman
  3. From: steve_biederman@mentorg.com (Steve Biederman)
  4. Subject:  Help with resizing window under mwm
  5. Sender: news@news.mentorg.com (News User)
  6. Message-ID: <1992Dec28.233729.29516@news.mentorg.com>
  7. Date: Mon, 28 Dec 1992 23:37:29 GMT
  8. Nntp-Posting-Host: slipknot.mentorg.com
  9. Organization: mentor
  10. Keywords: 
  11. Followup-To: 
  12. Lines: 27
  13.  
  14.     I'm a newcomer to X and to mwm.  I want to programmatically resize my
  15. window.  If I turn off mwm and simply run under X itself, a call to
  16. XMoveResizeWindow does the trick.  Under mwm, I'm first calling XsetNormalHints
  17. and then XMoveResizeWindow.  No dice.  What am I doing wrong?  My code fragment
  18. (slightly abstracted) follows.
  19.  
  20.  
  21.     /* Desired x, y, width, and height are already known */
  22.  
  23.     display = XOpenDisplay(displayname);
  24.     screen = DefaultScreen(display); root = RootWindow(display, screen);
  25.  
  26.     /* get which window the pointer is in */
  27.     XQueryPointer(display, root, &dummywin, &this_win, &rootx, &rooty, 
  28.                                                         &ptrx, &ptry, &modifs);
  29.  
  30.     /* tell the window manager where we'd like this to go */
  31.     size_hints.x = x;         size_hints.y = y; 
  32.     size_hints.width = width; size_hints.height = height;
  33.     size_hints.flags = USPosition | USSize;
  34.     XSetNormalHints(display, this_win, &size_hints);
  35.  
  36.     /* attempt to put it there */
  37.     XMoveResizeWindow(display, this_win, x, y, width, height);
  38.  
  39.     XFlush(display);
  40.  
  41.