home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5193 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  1.5 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!batcomputer!ghost.dsi.unimi.it!itnsg1.cineca.it!lele
  2. From: lele@itnsg1.cineca.it (Lele Gaifax)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Programmatically change a TextField under editing
  5. Message-ID: <1992Jul23.114709.22842@itnsg1.cineca.it>
  6. Date: 23 Jul 92 11:47:09 GMT
  7. Organization: Laboratorio di Fisica Computazionale, INFM. Trento Italia
  8. Lines: 27
  9.  
  10. I'm trying to change a TextField' content while the user is editing it.
  11. I replaced the TextFilterFunc for that TextField, and I want to do some
  12. fancy replacement to the text when the user press some keys. 
  13.  
  14. My textFilterFunc prototype is
  15. char * textFilterFunc (id textObj, char * inputText, int * inputLength,
  16.                int position);
  17.  
  18. I tried to do a "[[textObj setSel:startPos :endPos] replaceSel:replacement]"
  19. where of course startPos and endPos are integer position *inside* the text,
  20. and replacement is a string computed from the previous content.
  21.  
  22. What I see on the screen is the field get blanked... or something very similar.
  23.  
  24. I also tried using [textObj superview] and the setStringValue: on that
  25. TextField id, but the same happened.
  26.  
  27. How can I obtain the result I want? In few word, what I like to see is that
  28. whenever the user types BACKSPACE, the current character will be replaced by
  29. a blank, instead of getting deleted.
  30.  
  31. thanx a lot for any hints ...and forgive my poor english ;-)
  32. lele.
  33. -- 
  34. Lele Gaifax - lele@itnsg1.cineca.it
  35. Sicuramente i cattivi hanno scoperto qualche cosa che i buoni ignorano.
  36.                         - Woody Allen
  37.