home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / windows / x / 20854 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.9 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!doc.ic.ac.uk!uknet!lsl!snail
  2. From: snail@lsl.co.uk
  3. Newsgroups: comp.windows.x
  4. Subject: Re: Too Big XCreatePixmap returns ?
  5. Message-ID: <1993Jan7.124258.2899@lsl.co.uk>
  6. Date: 7 Jan 93 12:42:58 GMT
  7. References: <1993Jan4.195342.13271@news.dfrf.nasa.gov>
  8. Organization: Laser-Scan Ltd., Cambridge
  9. Lines: 37
  10.  
  11. In article <1993Jan4.195342.13271@news.dfrf.nasa.gov>, todd@fred.dfrf.nasa.gov (Todd Vernon) writes:
  12. > O'Reilly VII (page 108)  - XCreatePixmap returns a pixmap ID
  13. > Also BadAlloc, BadDrawable, BadValue can result.  I think I have
  14. > an idea why however my question is a follows.
  15. > How do I trap for instance BadAlloc as would happen if I ask for
  16. > a pixmap that is too big ?  This seems like a common problem
  17. > since off screen memory in X Servers is often limited ?
  18. > Is BadAlloc returned in place of the pixmap id ?
  19.  
  20. No, any error and you end up in the XErrorHandler, the default behaviour of
  21. which is to kill you program.
  22.  
  23. >  is zero 
  24. > returned ? help how do I do this ?
  25.  
  26. Just before you make the pixmap install an XErrorHandler using
  27. XSetErrorHandler(). If you get an X error the program will go to the function
  28. you've declared. Remove the error handler afterwards tho!
  29.  
  30. I'd be surprised if you make a pixmap this big, the server has paging space
  31. too!
  32.  
  33. We have one in place all the time (for debugging, put a breakpoint in the
  34. error handler and step up through the trace, useful in synchronise mode,
  35. although sometime the stack trace is sheepdip), we don't use it to trap
  36. specifics though.
  37. -- 
  38. snail@lsl.co.uk      
  39.  
  40. "Washing one's hands of the conflict between the powerful and the powerless
  41.  means to side with the powerful, not to be Neutral."
  42.                                                      Quote by Freire.
  43.                                                      Poster by OXFAM.
  44.