Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!usc!apple!sun-barr!newstop!sun!frisbee!jcb From: jcb@frisbee.Sun.COM (Jim Becker) Newsgroups: comp.windows.x Subject: Re^2: How can I check for a valid Window id? Message-ID: <127935@sun.Eng.Sun.COM> Date: 15 Nov 89 22:26:29 GMT References: <3103@harrier.ukc.ac.uk> <8911142110.AA17542@expire.lcs.mit.edu> Sender: news@sun.Eng.Sun.COM Lines: 39 rws@EXPO.LCS.MIT.EDU (Bob Scheifler) writes: -> If I do have to install an error handler how can I re-install the -> previous error handler if one had been installed (*I* cannot know about -> previous handlers that may have been installed)? ->In R4, XSetErrorHandler and XSetIOErrorHandler return the old handler. There is a little chunk of logic that seems to be missing from XLib. If the programmer is interested in capturing an operation that will force the error handler to be called they can install their own handler. However, they are unable to reset the value of a non-default handler correctly after their operation is complete. Having a routine that would return the current handler pointer would allow nesting to occur properly. This would be a routine `XGetErrorHandler()', thus: XGetErrorHandler( &old_handler ); XSetErrorHandler( new_handler ); ... whatever erroneous operations ... XSetErrorHandler( old_handler ); would allow correct nesting. I realize that this is a nit, but it has bitten at least myself in the past. Yet another item to add to the wish list for X, albeit minor. In the given case though, having a routine that determines validity and type given an arbitrary XID would also be a useful addition to the X wish list. -Jim Becker -- Jim Becker / jcb%frisbee@sun.com / Sun Microsystems ...these are my opinions, and even my id disagrees..