home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.windows.x:20603 comp.windows.x.motif:8244
- Path: sparky!uunet!think.com!rpi!usc!english
- From: english@alicudi.usc.edu (Joe English)
- Newsgroups: comp.windows.x,comp.windows.x.motif
- Subject: Re: Help Request for mwm send.msg
- Date: 29 Dec 1992 11:17:37 -0800
- Organization: Nerds of Action
- Lines: 58
- Distribution: world
- Message-ID: <1hq88hINN3qp@alicudi.usc.edu>
- References: <1992Dec22.134147.18146@cbnewsj.cb.att.com>
- Reply-To: joe@trystero.art.com
- NNTP-Posting-Host: alicudi.usc.edu
- Keywords: Motif, mwm, send.msg, XChangeProperty, Atom
-
-
- 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
-