Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!pasteur!graft!scott From: scott@graft.Berkeley.EDU (Scott Silvey) Newsgroups: comp.windows.x Subject: Re: placing widgets? Message-ID: <26394@pasteur.Berkeley.EDU> Date: 21 Jul 90 03:37:40 GMT References: <8775@ubc-cs.UUCP> Sender: news@pasteur.Berkeley.EDU Reply-To: scott@xcf.berkeley.edu Organization: UC Berkeley Experimental Computing Facility Lines: 86 lindholm@greve.ucs.ubc.ca (George Lindholm) writes: |> I have a form widget that contains two viewport widgets side-by-side. Below the |> viewport I have 3 command widgets that control the viewports. My question is, |> how do I position the the first one command widget so that its right edge is |> aligned with the right border of the first viewport, the second command |> widget so that it is centered in the form, and the third command widget so |> that its left side is aligned with the left side of the second viewport? |> |> I have tried adjusting both XtNx and XtNhorizDistance with no success. |> |> |> lindholm@staff.ucs.ubc.ca George_Lindholm@mtsg.ubc.ca USERGNL@UBCMTSG.BITNET |> University of British Columbia Computing Services |> (604) 228-4375 #include #include #include #include XtAppContext app_context; main(argc, argv) int argc; char *argv[]; { int n; Arg args[8]; Widget toplevel, form, view1, view2, but1, but2, but3; toplevel = XtAppInitialize(&app_context, "test", NULL, 0, &argc, argv, NULL, NULL, 0); form = XtCreateManagedWidget("form", formWidgetClass, toplevel, NULL, 0); n=0; XtSetArg(args[n], XtNtop, XtChainTop); n++; XtSetArg(args[n], XtNbottom, XtChainBottom);n++; XtSetArg(args[n], XtNheight, 100); n++; XtSetArg(args[n], XtNwidth, 100); n++; view1 = XtCreateManagedWidget("view1", labelWidgetClass, form, args, n); n=0; XtSetArg(args[n], XtNfromHoriz, view1); n++; XtSetArg(args[n], XtNtop, XtChainTop); n++; XtSetArg(args[n], XtNbottom, XtChainBottom);n++; XtSetArg(args[n], XtNheight, 100); n++; XtSetArg(args[n], XtNwidth, 100); n++; view2 = XtCreateManagedWidget("view2", labelWidgetClass, form, args, n); n=0; XtSetArg(args[n], XtNfromVert, view1); n++; XtSetArg(args[n], XtNtop, XtChainBottom); n++; XtSetArg(args[n], XtNbottom, XtChainBottom);n++; XtSetArg(args[n], XtNwidth, 65); n++; but1 = XtCreateManagedWidget("but1", labelWidgetClass, form, args, n); n=0; XtSetArg(args[n], XtNfromVert, view1); n++; XtSetArg(args[n], XtNfromHoriz, but1); n++; XtSetArg(args[n], XtNtop, XtChainBottom); n++; XtSetArg(args[n], XtNbottom, XtChainBottom);n++; XtSetArg(args[n], XtNwidth, 64); n++; but2 = XtCreateManagedWidget("but2", labelWidgetClass, form, args, n); n=0; XtSetArg(args[n], XtNfromVert, view1); n++; XtSetArg(args[n], XtNfromHoriz, but2); n++; XtSetArg(args[n], XtNtop, XtChainBottom); n++; XtSetArg(args[n], XtNbottom, XtChainBottom);n++; XtSetArg(args[n], XtNwidth, 65); n++; but2 = XtCreateManagedWidget("but2", labelWidgetClass, form, args, n); XtRealizeWidget(toplevel); XtAppMainLoop(app_context); }