[comp.windows.x.motif] Prompt Dialog question

hecht@excalibur.tn.cornell.EDU (Caroline Hecht) (12/03/90)

How can I create a widget that is like the PromptDialog (created with
XmCreatePromptDialog), except that I don't want to have to pop it up
with a pushbutton?  In other words, I want the entire program to be
this prompt; when the user clicks on "ok" or hits return, I'll exit.

I tried taking the pushbutton out, and managing the promptdialog widget
after creating it, but that failed due to "zero width/height for the
toplevel widget."  I've also tried a few other variations, but seem to
be getting nowhere -- I keep getting core dumps or working programs that
don't look right.  

Caroline Hecht
Cornell National Supercomputer Facility
cgh@cornellf.tn.cornell.edu   (Ignore addresses in header)
(607) 254-8686

libby@dumpling.osf.org (Libby Hanna) (12/11/90)

In article <1990Dec3.151858.11160@batcomputer.tn.cornell.edu> cgh@cornellf.tn.cornell.EDU (Caroline Hecht) writes:
>How can I create a widget that is like the PromptDialog (created with
>XmCreatePromptDialog), except that I don't want to have to pop it up
>with a pushbutton?  In other words, I want the entire program to be
>this prompt; when the user clicks on "ok" or hits return, I'll exit.
>I tried taking the pushbutton out, and managing the promptdialog widget
>after creating it, but that failed due to "zero width/height for the
>toplevel widget."  I've also tried a few other variations, but seem to
>be getting nowhere -- I keep getting core dumps or working programs that
>don't look right.  

I think the 'zero height/width' errors are because there are no children in
the top level shell, thus it has no size, and complains. Try explicitly setting
the height and width of the toplevel shell to something. That should solve it.

Libby Hanna
OSF Motif QA
<all opinions my own>

aw@bae.bae.bellcore.com (Andrew Wason) (12/12/90)

In article <1990Dec3.151858.11160@batcomputer.tn.cornell.edu>, hecht@excalibur.tn.cornell.EDU (Caroline Hecht) writes:
> How can I create a widget that is like the PromptDialog (created with
> XmCreatePromptDialog), except that I don't want to have to pop it up
> with a pushbutton?  In other words, I want the entire program to be
> this prompt; when the user clicks on "ok" or hits return, I'll exit.

Create an XmSelectionBox widget as the only child of
your toplevel shell.  Set the XmNdialogType resource
of the SelectionBox to XmDIALOG_PROMPT.  Then just
manage the SelectionBox and realize your toplevel.

Here's what you would do in Mri:

  Mri.wcChildren:     prompt
  *prompt.wcClass:    xmSelectionBoxWidgetClass
  *prompt.dialogType: DIALOG_PROMPT

Andrew

--------------------------------------------------------------------------------
Andrew Wason                                        Bell Communications Research
aw@cellar.bae.bellcore.com                          Piscataway, NJ
bellcore!cellar!aw