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