[comp.windows.x.motif] Adding standard Motif info/error/etc symbols to own widget

cm@jet.uucp (colin manning) (05/22/91)

I have a need to display the standard Motif error/warning/info etc
symbols that you get in the normal Motif message dialogs in my own
widgets.

Can this be done, and if so, how is it done ?
-- 
- Colin Manning, cm%jet.uucp@ukc.ac.uk (world) OR cm@jet.uucp (UK only)
- Disclaimer: Please note that the above is a personal view and should not 
  be construed as an official comment from the JET project.

nazgul@alfalfa.com (Kee Hinckley) (05/23/91)

> I have a need to display the standard Motif error/warning/info etc
> symbols that you get in the normal Motif message dialogs in my own
> widgets.
> 
> Can this be done, and if so, how is it done ?

First:

    //
    // Yes this looks really stupid, however it forces the initialization of
    // the dialog icons, which allows us to use them our own dialogs.
    //
    XtDestroyWidget(XmCreateMessageBox(MasterShell, "", NULL, 0));

Then:

    iconPixmap = XmGetPixmap(XtScreen(widget), "xm_error", fore, back);
    if (iconPixmap == XmUNSPECIFIED_PIXMAP) {
        iconPixmap = XmGetPixmap(XtScreen(widget), "default_xm_error", fore, back);
    }


No, none of this is documented.

Alfalfa Software, Inc.          |       Poste:  The EMail for Unix
nazgul@alfalfa.com              |       Send Anything... Anywhere
617/646-7703 (voice/fax)        |       info@alfalfa.com

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.