home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / fj / maillis / xwindow / 17496 < prev    next >
Encoding:
Internet Message Format  |  1992-11-16  |  1.9 KB

  1. Path: sparky!uunet!spool.mu.edu!sgiblab!nec-gw!nec-tyo!wnoc-tyo-news!scslwide!wsgw!wsservra!daemon
  2. From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
  3. Newsgroups: fj.mail-lists.x-window
  4. Subject: Re: Finding out the number of 'free' cells in the color map
  5. Message-ID: <1992Nov16.111538.13859@sm.sony.co.jp>
  6. Date: 16 Nov 92 11:15:38 GMT
  7. Sender: daemon@sm.sony.co.jp (The devil himself)
  8. Distribution: fj
  9. Organization: McGill Research Centre for Intelligent Machines
  10. Lines: 33
  11. Approved: michael@sm.sony.co.jp
  12.  
  13. Date: 15 Nov 92 19:31:25 GMT
  14. Message-Id: <1992Nov15.193125.19911@thunder.mcrcim.mcgill.edu>
  15. Newsgroups: comp.windows.x
  16. References: <1992Nov13.072332.27682@mailhost.ocs.mq.edu.au>
  17. Sender: xpert-request@expo.lcs.mit.edu
  18.  
  19. In article <1992Nov13.072332.27682@mailhost.ocs.mq.edu.au>, s8923098@macnab.mqcs.mq.oz.au (Josef WIDJAJA) writes:
  20.  
  21. > I want to use XAllocColor many times to allocate color cells that can
  22. > be shared by other applications.  But I want to know in advance how
  23. > many of these will be available.  How can I do this ?
  24.  
  25. You can't.  For one thing, it depends on exactly what colors you're
  26. allocating, because you may match colors that are already allocated and
  27. hence get an already-allocated cell instead of a new one.  Even if you
  28. rephrase it to ask "how many cells are unallocated", there is no simple
  29. way to answer it; you have to try it and see.  (Unless you want to
  30. design and implement an extension, of course.)
  31.  
  32. > [code example]
  33.  
  34. > I want to know how many color cells are going to be available so that
  35. > I can adjust the value of maxno, and prepare data[i]'s accordingly.
  36. > More specifically, I want to make sure that result is always
  37. > succesful(true).
  38.  
  39. Can't be done.  Even if you did contrive somehow to find out how many
  40. cells are free, other clients could allocate cells while you're
  41. working.  You'd have to grab the server to prevent this....
  42.  
  43.                     der Mouse
  44.  
  45.                 mouse@larry.mcrcim.mcgill.edu
  46.