home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / windows / x / 21462 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  2.1 KB

  1. Path: sparky!uunet!mcsun!uknet!lsl!snail
  2. From: snail@lsl.co.uk
  3. Newsgroups: comp.windows.x
  4. Subject: Re: XOpenDisplay
  5. Message-ID: <1993Jan22.110312.2958@lsl.co.uk>
  6. Date: 22 Jan 93 11:03:12 GMT
  7. References: <1993Jan21.144250.5872@newton.bioch.ox.ac.uk>
  8. Organization: Laser-Scan Ltd., Cambridge
  9. Lines: 53
  10.  
  11. In article <1993Jan21.144250.5872@newton.bioch.ox.ac.uk>, mikes@bioch.ox.ac.uk (Mike Smith) writes:
  12. > Dear dudes,
  13. > I am a beginner into X programming, and am being frustrated by the following
  14. > three lines:
  15. >   Display *display;
  16. >   char *display_name = NULL;
  17. >   display=XOpenDisplay(display_name);
  18. > (of course I have #include <X11/Xlib.h> and #include <X11/Xutil.h> at the top).
  19. > It seems to work Ok on those rare occasions when I can get on the computer where
  20. > it is being executed
  21.  
  22. I assume you mean a remote login, or displaying on a different machine to the
  23. one you are running on? If that is the case, then it maybe that you have not
  24. told the application where to display itself. This can be done as follows
  25.  
  26. either
  27.  
  28. 1) use the -display <display address> option on the command line.
  29.  
  30.    eg: myprog -display lsld5g:0.0
  31.        runs the program myprog on machine lsld5g, using display 0 and screen 0
  32.  
  33. or
  34.  
  35. 2) use the DISPLAY (unix) environment variable or DECW$DISPLAY (VMS) logical
  36.    (is it a logical? or something else?).
  37.  
  38.    eg: setenv DISPLAY lsld5g:0.0
  39.        to run the program:- myprog
  40.        this has the same effect as 1).
  41.  
  42.    if you are using the machine at the console, but logged in on a seperate
  43.    xterm (for example) you can setenv DISPLAY :0.0 or setenv DISPLAY unix:0.0
  44.  
  45. > from but otherwise I get a segmentation fault, when according
  46. > to the man pages I should wither get a Display structure from XOpenDisplay, or a
  47. > NULL.  I seem to be getting neither!
  48.  
  49. Funnily enough, we get a seg fault if the DISPLAY variable isn't set.
  50.  
  51. Hope it helps.
  52. -- 
  53. snail@lsl.co.uk      
  54.  
  55. "Washing one's hands of the conflict between the powerful and the powerless
  56.  means to side with the powerful, not to be Neutral."
  57.                                                      Quote by Freire.
  58.                                                      Poster by OXFAM.
  59.