home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.motif
- Path: sparky!uunet!think.com!paperboy.osf.org!juliet!daniel
- From: daniel@juliet.osf.org (Daniel Dardailler)
- Subject: Re: Centering button in form ?
- Message-ID: <1992Dec23.142215.9700@osf.org>
- Sender: daniel@juliet (Daniel Dardailler)
- Organization: Open Software Foundation, Motif Team
- References: <1992Dec22.175107.3484@news.dfrf.nasa.gov>
- Date: Wed, 23 Dec 1992 14:22:15 GMT
- Lines: 29
-
-
- |> -------------------------------
- |> | ---------------- |
- |> | | | |
- |> | --XmPushButton-- |
- |> ------------------------XmForm-
-
-
- Form does not support center attachment as a resource.
- You'll need to do some programming.
-
- You have to wait for after the Form first layout to be sure everybody
- got its natural size (the button and the form here).
- (unless you want to fix the sizes of your widgets, which is very bad).
-
- Calling a routine after XtRealize and before the main loop is fine.
-
- In this routine, do something like:
-
- n = 0;
- XtSetArg (args[n], XmNwidth, &width); n++;
- XtGetValues (push, args, n);
-
- n = 0;
- XtSetArg (args[n], XmNleftAttachment, XmATTACH_POSITION); n++;
- XtSetArg (args[n], XmNleftPosition, 50); n++;
- XtSetArg (args[n], XmNleftOffset, -((int)width)/2); n++;
- XtSetValues (push, args, n);
-
-