home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / 20473 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  2.4 KB

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