home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14512 < prev    next >
Encoding:
Text File  |  1992-08-25  |  1.9 KB  |  49 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!stanford.edu!kronos.arc.nasa.gov!joshr
  3. From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
  4. Subject: Re: updating window text / getting text lines from buffer
  5. Message-ID: <1992Aug25.232449.12720@kronos.arc.nasa.gov>
  6. Sender: usenet@kronos.arc.nasa.gov (Will Edgington, wedgingt@ptolemy.arc.nasa.gov)
  7. Nntp-Posting-Host: kronos-arclan.arc.nasa.gov
  8. Organization: NASA/ARC Information Sciences Division
  9. References: <86967@netnews.upenn.edu>
  10. Date: Tue, 25 Aug 1992 23:24:49 GMT
  11. Lines: 36
  12.  
  13. In article <86967@netnews.upenn.edu> peter@sysnext.library.upenn.edu (Peter C. Gorman) writes:
  14. >I have a couple of basic text-handling questions (using Think C):
  15. >1. What's the standard way to update text in a window?  For instance, if I  
  16. >display a value that needs to be changed periodically, do I DrawString(),  
  17. >then at update time draw a white rectangle over it and DrawString with the  
  18. >new value?
  19.  
  20. This is a good, quick way.
  21.  
  22. >
  23. >2. If I load a text file into a buffer, what's the best way to get it out  
  24. >a line at a time?  Do I write a version of fgets that gets it from the  
  25. >buffer, or is this a standard Mac function that's posted somewhere?
  26.  
  27. Sure, write the fgets-type function.  there is a method of reading from 
  28. a file documented somewhere in IM for getting the filemanager to
  29. parse files into lines delimited by any desired char ('\n' in this case)
  30. using PBRead (I believe).
  31.  
  32. If anyone has written a code snippet that does this, pls. inform me
  33. as to how this is done.  Posting here is okay, but mailing me a code snippet
  34. would be godly.
  35.  
  36. Thanks
  37.  
  38. >Peter Gorman
  39. >University of Pennsylvania
  40. >Library Systems Office
  41. >peter@sysnext.library.upenn.edu
  42.  
  43.  
  44. -- 
  45. ----------------------------------
  46. #include <std/disclaimer.h>     Josh Rabinowitz, Mac TCL programmer
  47. joshr@kronos.arc.nasa.gov
  48. "Send a salami to your boy in the army" - Katz's delicatessen, NYC
  49.