🚀 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 Fri, 21 Aug 1992 12:35
How to change the cursor position in a TextField?
#1257
Author: Lele Gaifax
Date: Fri, 21 Aug 1992 12:35
37 lines
1578 bytes
Hi again,
I'm still trying to get a better response from a TextField (from my pov, of
course !-).
I'd like to be able to programmatically change the contents of a TextField:
whenever the user press the BackSpace key, I want the character preceeding the
caret to be blanked, WITHOUT any other change in the text. In other words,
if the user keeps pressing the BackSpace key, all the previous characters
should be blanked, ie changed to blank chars, instead of removed at all.

My approach is simple; in my TextFilterFunction I do this:

static char *
myTextFilter (id textObj,
	      char * inputText,
	      int * inputLength,
	      int position)
{
  ...
  if (*inputText == NX_BACKSPACE)
  {
    [textObj setSel:position-1 :position];
    return " ";
  }
  ...
}

and it does work, but the caret obviously doesn't move and it keeps blanking
the same position.
Is it possible to move the caret from the application? How? (I tryied using
moveCaret: but it does not work at all!)

Thanx a lot, 
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