ado@elsie.UUCP (Arthur David Olson) (02/26/89)
Suppose I compile this code, naming the executable "try":
#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/Box.h>
int
main(argc, argv)
int argc;
char * argv[];
{
Widget widget;
Arg args[2];
widget = XtInitialize("main", "Demo",
(XrmOptionDescRec *) NULL, 0, &argc, argv);
XtSetArg(args[0], "width", 100);
XtSetArg(args[1], "height", 100);
XtSetValues(widget, args, 2);
if (argc > 1)
(void) XtCreateManagedWidget("box", boxWidgetClass,
widget, (ArgList) NULL, 0);
XtRealizeWidget(widget);
XtMainLoop();
}
If I then use the command
try -geometry +0+0 x
the geometry option is heeded and the created window appears in the
upper-left-hand corner of my screen. But if I do a plain
try -geometry +0+0
(so that the top-level widget has no children) the geometry option is not
heeded.
Should I be surprised by this? In those cases where I'm using the toolkit
only to get standardized option processing, is there some way of getting
geometry options heeded other than by creating a phony child widget?
--
Arthur David Olson ado@ncifcrf.gov ADO is a trademark of Ampex.
kit@ATHENA.MIT.EDU (Chris D. Peterson) (03/15/89)
> (so that the top-level widget has no children) the geometry option is not > heeded. It appears the the current MIT implementation of the Shell widget does not parse the geometry string unless it has a child. From reading the Shell widget specification this appears to be a bug. I am going to forward this to xbugs. Chris D. Peterson MIT X Consortium / Project Athena Net: kit@athena.mit.edu Phone: (617) 253 - 1326 USMail: MIT - Room E40-321 77 Massachusetts Ave. Cambridge, MA 02139