home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / motif / 8264 < prev    next >
Encoding:
Text File  |  1992-12-30  |  2.1 KB  |  74 lines

  1. Path: sparky!uunet!noc.near.net!bigboote.WPI.EDU!dxn
  2. From: Deepak.Narain@cs.WPI.EDU (Deepak Narain)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Does a forked proc need something special to do Motif stuff?
  5. Date: 30 Dec 1992 20:50:18 GMT
  6. Organization: Department of Computer Science, WPI
  7. Lines: 61
  8. Distribution: world
  9. Message-ID: <1ht22aINNcml@bigboote.WPI.EDU>
  10. NNTP-Posting-Host: ivy.wpi.edu
  11. Originator: dxn@ivy
  12.  
  13. I am writing a motif application that forks off a child process
  14. (an xterm).  My problem is that the forked off process does not
  15. display my widget - a MessageDialog.  What I do to get around 
  16. the problem is trap SIGCLD, and display the widget from the parent
  17. process, but, this is not what I want to do.  Has anybody ever run
  18. into this problem before?  
  19.  
  20. This is the piece of code that I use to do the display from the child
  21. (i.e, without setting up the signal stuff).
  22.  
  23. /* start here */
  24. ....
  25.  
  26. char *command = "/usr/bin/X11/xterm -e /usr/ucb/vi"
  27. char *confirm[] = {"Confirm", "", ""};
  28.  
  29. int forked_pid = fork();
  30.  
  31. switch(forked_pid)
  32. {
  33.    case(-1):
  34.       DisplayError("Fork Failed");
  35.       return;
  36.  
  37.    case (0):
  38.       system(command);
  39.       DisplayHelp(confirm);
  40.       exit(0)
  41.  
  42.    default:
  43.       return;
  44.       break;
  45. }
  46.  
  47. ...
  48. /* end here */
  49.  
  50. The DisplayHelp is taken from the Young book, with a few minor mods, 
  51. it works in all other cases, so I don't think that the problem is 
  52. with that.  This is the error that I have been getting:
  53.  
  54. X Error of failed request:  BadAtom (invalid Atom parameter)
  55.   Major opcode of failed request:  18 (X_ChangeProperty)
  56.   Minor opcode of failed request:  0
  57.   Resource id in failed request:  0xb0004c
  58.   Serial number of failed request:  625
  59.   Current serial number in output stream:  499
  60. X Error of failed request:  BadAtom (invalid Atom parameter)
  61.   Major opcode of failed request:  18 (X_ChangeProperty)
  62.   Minor opcode of failed request:  0
  63.   Resource id in failed request:  0xb0004c
  64.   Serial number of failed request:  621
  65.   Current serial number in output stream:  612
  66.  
  67.  
  68. Help...please.
  69.  
  70. Thanks,
  71.  
  72. ------------------------------------------------------------------------
  73. Deepak Narain                                   Deepak.Narain@cs.wpi.edu
  74.