home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / windows / x / 19166 < prev    next >
Encoding:
Internet Message Format  |  1992-11-15  |  1.7 KB

  1. Path: sparky!uunet!know!cass.ma02.bull.com!think.com!rpi!usc!cs.utexas.edu!torn!utcsri!newsflash.concordia.ca!sifon!thunder.mcrcim.mcgill.edu!mouse
  2. From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
  3. Newsgroups: comp.windows.x
  4. Subject: Re: Finding out the number of 'free' cells in the color map
  5. Keywords: color map, color cells
  6. Message-ID: <1992Nov15.193125.19911@thunder.mcrcim.mcgill.edu>
  7. Date: 15 Nov 92 19:31:25 GMT
  8. References: <1992Nov13.072332.27682@mailhost.ocs.mq.edu.au>
  9. Organization: McGill Research Centre for Intelligent Machines
  10. Lines: 28
  11.  
  12. In article <1992Nov13.072332.27682@mailhost.ocs.mq.edu.au>, s8923098@macnab.mqcs.mq.oz.au (Josef WIDJAJA) writes:
  13.  
  14. > I want to use XAllocColor many times to allocate color cells that can
  15. > be shared by other applications.  But I want to know in advance how
  16. > many of these will be available.  How can I do this ?
  17.  
  18. You can't.  For one thing, it depends on exactly what colors you're
  19. allocating, because you may match colors that are already allocated and
  20. hence get an already-allocated cell instead of a new one.  Even if you
  21. rephrase it to ask "how many cells are unallocated", there is no simple
  22. way to answer it; you have to try it and see.  (Unless you want to
  23. design and implement an extension, of course.)
  24.  
  25. > [code example]
  26.  
  27. > I want to know how many color cells are going to be available so that
  28. > I can adjust the value of maxno, and prepare data[i]'s accordingly.
  29. > More specifically, I want to make sure that result is always
  30. > succesful(true).
  31.  
  32. Can't be done.  Even if you did contrive somehow to find out how many
  33. cells are free, other clients could allocate cells while you're
  34. working.  You'd have to grab the server to prevent this....
  35.  
  36.                     der Mouse
  37.  
  38.                 mouse@larry.mcrcim.mcgill.edu
  39.