Path: utzoo!utgpu!watserv1!watmath!att!bellcore!rutgers!ucsd!helios.ee.lbl.gov!ncis.tis.llnl.gov!lll-winken!sun-barr!newstop!sun!claris!ClarisII!pierre From: pierre@ClarisII.claris.com (Pierre Omidyar) Newsgroups: comp.sys.mac.programmer Subject: Re: when color bits are changed... Message-ID: Date: 10 Jul 90 19:09:43 GMT References: Sender: news@claris.com Lines: 32 X-Local-Date: 10 Jul 90 12:09:43 PDT hh0x+@andrew.cmu.edu (Hiroshi Rit Howell) writes: >Does anyone know how an application can be noticed for user changing >the current color bits (I don't know the technical term),eg, from 8bit to 1bit >from the control panel's monitor? I suppose this is followed by an update >event of some sort.....or do I have toonstantly check by placing 256 different >colors and see how meny of them become same color? no...... there got to be >a better way.... >hiroshi howell (hh0x@andrew.cmu.edu) Your app should get an update event when the user changes monitor depth, and you can check the new depth by checking the pixelSize field of the pixMap of the GDevice your window is on. GDevices are covered in IM Volume 5 Chapter 5, and PixMaps are covered in Volume 5 Chapter 4. Essentially, you would do a GetMaxDevice, passing it the global rect of your window, and then check the field, (*(*maxDevice)->gdPMap)->pixelSize. You can compare this value to one you have saved somewhere to see if it has changed. Typically, this value will be 1,2,4,8,16, or 32. This is probably a sketchy description of what you really need to do, but you should be able to find it all in Volume 5. Pierre -- -- Pierre Omidyar {ames,apple,portal,sun,voder}!claris!pierre Claris Corporation pierre@claris.com Opinions are mine and not Claris'