[comp.windows.x] Univeral invalid XID

art@dinorah.mit.EDU (Arthur B. Smith) (02/09/89)

Hello!

Is there any value that is never a valid XID?  I would like to know if a 
window has been defined just by checking the value of the window, not 
carrying around another flag.  In X.h "None" is #define'd to 0L with the
comment "universal null resource or null atom".  Does that mean I can
do something like

if (win == None)
	win = XCreateSimpleWindow(...);

?  TIA.

	art smith (art@dinorah.wustl.edu)

kit@ATHENA.MIT.EDU (Chris D. Peterson) (02/10/89)

> In X.h "None" is #define'd to 0L with the
> comment "universal null resource or null atom".  Does that mean I can
> do something like

> if (win == None)
> 	win = XCreateSimpleWindow(...);

Yep, this will work just fine.

You must have a line like this above the conditional, of course.

Window win = None;

						Chris D. Peterson     
						MIT X Consortium /
						Project Athena 

Net:	kit@athena.mit.edu		
Phone: (617) 253 - 1326			
USMail: MIT - Room E40-321
	77 Massachusetts Ave.		
	Cambridge, MA 02139