Message boxes

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

5 posts / 0 new
Last post
Message boxes

Submitted by Anonymous on Mon, 02/26/2001 - 20:10. Developers
Hey guys,

on MS Windows i create and show a Message Box (Warning Box, Information Box, whatever) like that

int nReturnValue = MessageBox(...);
It`s only one line to write, and the message box is modal; there can`t be more then one.

So how do you do that with Motif? XmCreateWarningDialogs works, but it`s not modal (when i click on "Quit" in my menu bar the m`box popups, but while it`s shown on the screen i can still click on "Quit" and the same box pops up for the second time...).
And i don`t want to mess around with callback functions, i just want to know if the user clicked on `OK` or `Cancel`. Is there a way to find that out?

Thanks for your help,
Chris

leetuckert

Try setting XmNdialogStyle to XmDIALOG_PRIMARY_APPLICATION_MODAL. See
the man page on XmBulletinBoard for more information...

Anonymous

Hi tuckert,

thanks for your help, the message box is modal now. I even managed to rename the "OK"-button to a "Yes"-button.

But i still haven`t found a way to avoid using callback funtions, or to find out which button was pressed before the dialog was closed...

ICS_support

There`s code to do this in the comp.windows.x.FAQ, which you can find pointers to at http//www.motifzone.com/resources/other.html . Look for answer #157.

What you`re looking for is an "in-line" response. The code does its own event-handling and returns an answer to you.

Anonymous

That was exactly what i was looking for. Thank you very much!