Article View: comp.sys.next.programmer
Article #197Programmatically change a TextField under editing
From: Lele Gaifax
Date: Thu, 23 Jul 1992 11:47
Date: Thu, 23 Jul 1992 11:47
27 lines
1600 bytes
1600 bytes
I'm trying to change a TextField' content while the user is editing it. I replaced the TextFilterFunc for that TextField, and I want to do some fancy replacement to the text when the user press some keys. My textFilterFunc prototype is char * textFilterFunc (id textObj, char * inputText, int * inputLength, int position); I tried to do a "[[textObj setSel:startPos :endPos] replaceSel:replacement]" where of course startPos and endPos are integer position *inside* the text, and replacement is a string computed from the previous content. What I see on the screen is the field get blanked... or something very similar. I also tried using [textObj superview] and the setStringValue: on that TextField id, but the same happened. How can I obtain the result I want? In few word, what I like to see is that whenever the user types BACKSPACE, the current character will be replaced by a blank, instead of getting deleted. thanx a lot for any hints ...and forgive my poor english ;-) lele. -- Lele Gaifax - lele@itnsg1.cineca.it Sicuramente i cattivi hanno scoperto qualche cosa che i buoni ignorano. - Woody Allen
Technical Details
Message-ID:
<1992Jul23.114709.22842@itnsg1.cineca.it>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!batcomputer!ghost.dsi.unimi.it!itnsg1.cineca.it!leleShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!batcomputer!ghost.dsi.unimi.it!itnsg1.cineca.it!lele From: lele@itnsg1.cineca.it (Lele Gaifax) Newsgroups: comp.sys.next.programmer Subject: Programmatically change a TextField under editing Message-ID: <1992Jul23.114709.22842@itnsg1.cineca.it> Date: 23 Jul 92 11:47:09 GMT Organization: Laboratorio di Fisica Computazionale, INFM. Trento Italia Lines: 27