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

  1. Newsgroups: comp.windows.x.motif
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!cbnewsc!dwd
  3. From: dwd@cbnewsc.cb.att.com (David W. Dykstra)
  4. Subject: Re: How do I tell Motif where to position my TopLevelShell?
  5. Organization: AT&T
  6. Date: Wed, 23 Dec 1992 23:06:00 GMT
  7. Message-ID: <1992Dec23.230600.10343@cbnewsc.cb.att.com>
  8. References: <1992Dec18.184431.23910@mlb.semi.harris.com>
  9. Lines: 31
  10.  
  11. > When I run the following code to create a new topLevelShell, the
  12. > location (position) of the window is done by Motif - it ignores my XmNx
  13. > and XmNy arguments completely.  Does anyone know how to specifically
  14. > place a topLevelShell?  I've checked the FAQ and about a year's worth of
  15. > past postings, no luck.  Also note that XmNdefaultPosition doesn't
  16. > affect it. Thanks.
  17. > -------------------------------
  18. > ac = 0;
  19. > XtSetArg (al[ac], XmNx, sx);  ac++;
  20. > XtSetArg (al[ac], XmNy, sy);  ac++;
  21. > XtSetArg (al[ac], XmNwidth, 50);  ac++;
  22. > XtSetArg (al[ac], XmNheight, 100);  ac++;
  23. > top = XtAppCreateShell("x", "x", applicationShellWidgetClass,
  24. >                 XtDisplay(w), al, ac);
  25. > XtRealizeWidget(top);
  26. > -------------------------------
  27.  
  28. I've had success with both setting the geometry resource and with setting
  29. x and y after the top level shell is created.  I set the geometry resource
  30. before the widget is managed and set x and y to move things later.  I'm
  31. not sure anymore if those are the only ways that work but I think so.
  32.  
  33. The bad thing about setting x and y after the window is managed is that
  34. those values don't include the window manager border.  I have to go
  35. through a lot of trouble to find the window that the window manager has placed
  36. around mine and determine its size in order to figure out what x and y
  37. I really want.
  38.  
  39. - Dave Dykstra
  40.   dwd@graceland.ih.att.com
  41.