home *** CD-ROM | disk | FTP | other *** search
- 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
- From: snail@lsl.co.uk
- Newsgroups: comp.windows.x
- Subject: Re: Too Big XCreatePixmap returns ?
- Message-ID: <1993Jan7.124258.2899@lsl.co.uk>
- Date: 7 Jan 93 12:42:58 GMT
- References: <1993Jan4.195342.13271@news.dfrf.nasa.gov>
- Organization: Laser-Scan Ltd., Cambridge
- Lines: 37
-
- In article <1993Jan4.195342.13271@news.dfrf.nasa.gov>, todd@fred.dfrf.nasa.gov (Todd Vernon) writes:
- >
- > O'Reilly VII (page 108) - XCreatePixmap returns a pixmap ID
- >
- > Also BadAlloc, BadDrawable, BadValue can result. I think I have
- > an idea why however my question is a follows.
- >
- > How do I trap for instance BadAlloc as would happen if I ask for
- > a pixmap that is too big ? This seems like a common problem
- > since off screen memory in X Servers is often limited ?
- >
- > Is BadAlloc returned in place of the pixmap id ?
-
- No, any error and you end up in the XErrorHandler, the default behaviour of
- which is to kill you program.
-
- > is zero
- > returned ? help how do I do this ?
-
- Just before you make the pixmap install an XErrorHandler using
- XSetErrorHandler(). If you get an X error the program will go to the function
- you've declared. Remove the error handler afterwards tho!
-
- I'd be surprised if you make a pixmap this big, the server has paging space
- too!
-
- We have one in place all the time (for debugging, put a breakpoint in the
- error handler and step up through the trace, useful in synchronise mode,
- although sometime the stack trace is sheepdip), we don't use it to trap
- specifics though.
- --
- snail@lsl.co.uk
-
- "Washing one's hands of the conflict between the powerful and the powerless
- means to side with the powerful, not to be Neutral."
- Quote by Freire.
- Poster by OXFAM.
-