home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!sgiblab!nec-gw!nec-tyo!wnoc-tyo-news!scslwide!wsgw!wsservra!onoe
- From: english@alicudi.usc.edu (Joe English)
- Newsgroups: fj.mail-lists.x-window
- Subject: Re: Help Request for mwm send.msg
- Message-ID: <1992Dec29.223440.13014@sm.sony.co.jp>
- Date: 29 Dec 92 22:34:40 GMT
- Sender: onoe@sm.sony.co.jp (Atsushi Onoe)
- Distribution: fj
- Organization: Nerds of Action
- Lines: 64
- Approved: michael@sm.sony.co.jp
-
- Date: 29 Dec 1992 11:17:37 -0800
- Message-Id: <1hq88hINN3qp@alicudi.usc.edu>
- Newsgroups: comp.windows.x,comp.windows.x.motif
- References: <1992Dec22.134147.18146@cbnewsj.cb.att.com>
- Sender: xpert-request@expo.lcs.mit.edu
-
-
- In article <1992Dec22.134147.18146@cbnewsj.cb.att.com>, daver@cbnewsj.cb.att.com (dave.robertson) writes:
-
- |> I am having problems trying to use the send_msg function in mwm.
- |> I need to add an application specific capability to each window
- |> manager menu, and I believe that this can be achieved in this manner.
-
- |> Firstly in my mwm configuration file I define the menu as follows :
- |>
- |> Menu DefaultWindowMenu MwmWindowMenu
- |> {
- |> MyFunc f.send_msg 123
-
- You probably should *not* put this in the mwm configuration file.
- There's no guarantee that 123 will correspond to a valid atom.
- (I have no idea why f.send_msg wants the atom number instead of
- the atom name as it's argument; it looks like a serious design bug.)
-
- What I do instead is something like:
-
- Atom message_atom;
- message_atom = XmInternAtom(dpy, "MY_MESSAGE", False);
- sprintf(buf,"MyFunc f.send_msg %d\n",(int)message_atom);
- XtVaSetValues(shell, XmNmwmMenu,buf, NULL);
- /* Or: */
- Atom motif_wm_menu = XInternAtom(dpy,"_MOFTIF_WM_MENU", False);
- XChangeProperty(dpy,win, motif_wm_menu, motif_wm_menu, 8,
- PropModeReplace, buf, strlen(buf));
-
- i.e., add the extra menu options from the application itself, not
- from the Mwm configuration file.
-
-
- |> wm_motif_messages = XInternAtom(dpy, "_MOTIF_WM_MESSAGES", FALSE);
- |> static int helpmsg = 123;
- |>
- |> XChangeProperty(dpy, win, wm_motif_messages, XA_INTEGER, 32,
- ^^^^^^^^^^
- |> PropModeReplace, (unsigned char *) &helpmsg, 1);
-
- This could be the problem; _MOTIF_WM_MESSAGES is supposed to be
- of type ATOM. You also might want to make sure that _MOTIF_WM_MESSAGES
- is in the WM_PROTOCOLS list, though I'm not sure if it's necessary.
- I think that the VendorShell(?) does this automatically.
-
- It's easier just to use:
-
- XmAddProtocolCallback(shell, _motif_wm_messages, message_atom,
- MyCallback, MyCallbacksClosure);
-
- but since you're not using the Motif toolkit that's not an
- option.
-
- Hope this helps,
-
- --Joe English
-
- joe@trystero.art.com
-