🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
1 messages
1 total messages Started by Lele Gaifax Thu, 23 Jul 1992 11:47
Programmatically change a TextField under editing
#197
Author: Lele Gaifax
Date: Thu, 23 Jul 1992 11:47
27 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads