Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!decwrl!adobe!asente From: asente@adobe.com (Paul Asente) Newsgroups: comp.windows.x.motif Subject: Re: Help with application positioning (follow-up) Message-ID: <5792@adobe.UUCP> Date: 21 Aug 90 20:47:01 GMT References: <244@erb1.engr.wisc.edu> <141019@sun.Eng.Sun.COM> Sender: news@adobe.COM Distribution: usa Organization: Adobe Systems Inc. Lines: 43 In article <141019@sun.Eng.Sun.COM> argv@turnpike.Eng.Sun.COM (Dan Heller) writes: >Use the XtNgeometry resource. Thus, instead of: >> XtSetArg(args[i],XmNheight,750); i++; >> XtSetArg(args[i],XmNwidth,750); i++; >> XtSetArg(args[i],XmNx,0); i++; >> XtSetArg(args[i],XmNy,0); i++; >Use: >> XtSetArg(args[i], XtNgeometry, "750x750+0+0"); i++; This is a Very Very bad thing to do. Not on the same level as committing serial axe murders, but bad nonetheless. Here's why: There are flags that an application passes to the window manager that tell whether the geometry the application specified came from the user or from the application. Many window managers pay attention to these flags; usually they place the window as requested if the flags say the geometry came from the user and use some other placement option (like asking the user) if the geometry came from the application. The Toolkit sets these flags by looking at whether or not the geometry resource is specified: having a geometry resource indicates user specified, and not having a geometry resource indicates program specified. If your application sets the geometry resource itself, it is lying to the window manager, claiming that the user specified the geometry. Now, why should you as a programmer feel obliged not to lie with the window manager? If you do this, there's no longer any way for a user who *wants* interactive position to get it. You may not personally care about this, but, rest assured, somebody will. So, briefly: To give the application's suggested geometry, set the x, y, width, and height. Do not set the geometry. A user who always wants a particular geometry can put a app.geometry: line in his or her .Xdefaults file. A user who wants interactive positioning sets nothing. -paul asente New address! asente@adobe.com ...decwrl!adobe!asente