home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / fj / maillis / xwindow / 18830 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  2.5 KB

  1. Path: sparky!uunet!spool.mu.edu!sgiblab!nec-gw!nec-tyo!wnoc-tyo-news!scslwide!wsgw!wsservra!onoe
  2. From: daver@cbnewsj.cb.att.com (dave.robertson)
  3. Newsgroups: fj.mail-lists.x-window
  4. Subject: Help Request for mwm send.msg
  5. Message-ID: <1992Dec22.154204.648@sm.sony.co.jp>
  6. Date: 22 Dec 92 15:42:04 GMT
  7. Sender: onoe@sm.sony.co.jp (Atsushi Onoe)
  8. Distribution: fj
  9. Organization: AT&T
  10. Lines: 63
  11. Approved: michael@sm.sony.co.jp
  12.  
  13. Date: Tue, 22 Dec 1992 13:41:47 GMT
  14. Message-Id: <1992Dec22.134147.18146@cbnewsj.cb.att.com>
  15. Newsgroups: comp.windows.x,comp.windows.x.motif
  16. Sender: xpert-request@expo.lcs.mit.edu
  17.  
  18.  
  19. I tried posting this last week, but received no response or suggestions
  20. from the motif newsgroup, and so I am re-posting and also cross-posting
  21. to comp.windows.x .........
  22.  
  23. I am having problems trying to use the send_msg function in mwm.
  24. I need to add an application specific capability to each window
  25. manager menu, and I believe that this can be achieved in this manner.
  26.  
  27. Firstly in my mwm configuration file I define the menu as follows : 
  28.  
  29. Menu DefaultWindowMenu MwmWindowMenu
  30. {
  31.     MyFunc              f.send_msg 123
  32.     Restore             f.normalize
  33.     Minimize            f.minimize
  34.     Maximize            f.maximize
  35.     Lower               f.lower
  36.     no-label            f.separator
  37.     Close               f.kill
  38. }
  39.  
  40. where MyFunc is my application specific capability.
  41. On startup, I do the following:
  42.  
  43. Atom    wm_motif_messages;
  44.  
  45. wm_motif_messages = XInternAtom(dpy, "_MOTIF_WM_MESSAGES", FALSE);
  46.  
  47. Then, when windows are created:
  48.  
  49. static    int    helpmsg = 123;
  50.  
  51. XChangeProperty(dpy, win, wm_motif_messages, XA_INTEGER, 32,
  52.                 PropModeReplace, (unsigned char *) &helpmsg, 1);
  53.  
  54. I then check for the appropriate ClientMessage event while the application
  55. is running.
  56.  
  57. My problem is that MyFunc is always dimmed. What am I doing wrong?
  58. I suspect that my XChangeProperty() call may be at fault and I have
  59. tried a few variations on the above. If I run xprop on one of my windows
  60. then it appears that the message number 123 has been correctly registered
  61. with the _MOTIF_WM_MESSAGES property.
  62.  
  63. One further point, I am not using the Motif toolkit but instead a 
  64. proprietary Xlib based class library. The principles ought to be the
  65. same though.
  66.  
  67. If anyone has done this before and has code segments that they don't
  68. mind sharing, or any suggestions, I'd really appreciate it.
  69.  
  70. Dave Robertson
  71. Consultant                att!mtnms!dar
  72. AT&T Paradyne
  73. Middletown, NJ                (908) 957 3925
  74.  
  75. // "All I want for Christmas is for my send.msg to work!"
  76.