Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!rpi!bu.edu!att!att!ima!dirtydog!ima.isc.com!brian From: rowan@ima.isc.com (Rowan Hawthorne) Newsgroups: comp.windows.x.motif Subject: Re: Dialog Box Actions Message-ID: <1990Dec13.204634.1731@dirtydog.ima.isc.com> Date: 13 Dec 90 20:46:34 GMT References: <1990Dec13.130121.23325@hellgate.utah.edu> Sender: news@dirtydog.ima.isc.com (NEWS ADMIN) Reply-To: rowan@ima.isc.com Organization: Interactive Systems, Cambridge, MA 02138 Lines: 56 In article <1990Dec13.130121.23325@hellgate.utah.edu>, wtm%gr.utah.edu@cs.utah.edu (Thomas McCollough) writes: |> I want to make a dialog box that has a row of push buttons along the |> bottom ("OK", "Reset", etc.). I want the row of pushbuttons to stretch |> and shrink just like they do in InformationDialog, QuestionDialog, |> etc. I've been using PushButtons in a RowColumn widget, but I haven't |> been able to make it look as slick as what I see in InformationDialog, |> QuestionDialog, etc. How should I do this? |> |> Thanks, |> Tom McCollough |> U of Utah CS Dept. This ought to be in the FAQ list, if it isn't already. Here's what you do. The two tricks are that you unmanage the stuff in a prompt dialog, and that you can add one more child to a Prompt dialog and it will put it in the correct place. Enjoy. /* Copyright 1990, Kee Hinckley and Brian Holt Hawthorne */ /* Permission granted for any use, provided this copyright */ /* notice is maintained. */ /* Create a dialog box */ argcount = setArgs(&args, XmNautoUnmanage, False, NULL); SomeDialog = XmCreatePromptDialog(mainShell, "someDialog", args, argcount); /* Now get rid of the things we don't want */ child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_SELECTION_LABEL); XtUnmanageChild(child); child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_TEXT); XtUnmanageChild(child); /* set the callbacks, and make sure the buttons we want are there */ child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_OK_BUTTON); XtAddCallback(child, XmNactivateCallback, callSomeFunc, someArg); XtAddCallback(child, XmNactivateCallback, unManage, SomeDialog); XtManageChild(child); child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_APPLY_BUTTON); XtAddCallback(child, XmNactivateCallback, callSomeFunc, someOtherArg); XtManageChild(child); child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_CANCEL_BUTTON); XtAddCallback(child, XmNactivateCallback, dialogUnmanage, SomeDialog); XtManageChild(child); /* Add a new work area. This can be any manager. */ child = XmCreateForm(SomeDialog, "someForm", NULL, 0); XtManageChild(child); /* and fill it up... */ something = doYourStuff(child); Rowan Email rowan@ima.isc.com Phone 617-661-7474 x206 Fax 617-661-2070 upstream from the last bend in the Charles River