home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!bigboote.WPI.EDU!dxn
- From: Deepak.Narain@cs.WPI.EDU (Deepak Narain)
- Newsgroups: comp.windows.x.motif
- Subject: Does a forked proc need something special to do Motif stuff?
- Date: 30 Dec 1992 20:50:18 GMT
- Organization: Department of Computer Science, WPI
- Lines: 61
- Distribution: world
- Message-ID: <1ht22aINNcml@bigboote.WPI.EDU>
- NNTP-Posting-Host: ivy.wpi.edu
- Originator: dxn@ivy
-
- I am writing a motif application that forks off a child process
- (an xterm). My problem is that the forked off process does not
- display my widget - a MessageDialog. What I do to get around
- the problem is trap SIGCLD, and display the widget from the parent
- process, but, this is not what I want to do. Has anybody ever run
- into this problem before?
-
- This is the piece of code that I use to do the display from the child
- (i.e, without setting up the signal stuff).
-
- /* start here */
- ....
-
- char *command = "/usr/bin/X11/xterm -e /usr/ucb/vi"
- char *confirm[] = {"Confirm", "", ""};
-
- int forked_pid = fork();
-
- switch(forked_pid)
- {
- case(-1):
- DisplayError("Fork Failed");
- return;
-
- case (0):
- system(command);
- DisplayHelp(confirm);
- exit(0)
-
- default:
- return;
- break;
- }
-
- ...
- /* end here */
-
- The DisplayHelp is taken from the Young book, with a few minor mods,
- it works in all other cases, so I don't think that the problem is
- with that. This is the error that I have been getting:
-
- X Error of failed request: BadAtom (invalid Atom parameter)
- Major opcode of failed request: 18 (X_ChangeProperty)
- Minor opcode of failed request: 0
- Resource id in failed request: 0xb0004c
- Serial number of failed request: 625
- Current serial number in output stream: 499
- X Error of failed request: BadAtom (invalid Atom parameter)
- Major opcode of failed request: 18 (X_ChangeProperty)
- Minor opcode of failed request: 0
- Resource id in failed request: 0xb0004c
- Serial number of failed request: 621
- Current serial number in output stream: 612
-
-
- Help...please.
-
- Thanks,
-
- ------------------------------------------------------------------------
- Deepak Narain Deepak.Narain@cs.wpi.edu
-