Texteditor line by line

Discuss GUI programming with the RapaGUI plugin here
Post Reply
ilbarbax
Posts: 114
Joined: Thu Apr 01, 2010 6:41 pm

Texteditor line by line

Post by ilbarbax »

How can I handle the texteditor line by line?

The only actual solution I found is to copy the text into a table where each table item is a texteditor line being split by chr(10).
Once modified I rewrite the entire texteditor text by merging the table lines.

This is not a good solution as I duplicate the data and I have a double handling.

I'm also in difficulties to set the Area Mark because it requires the character count of all previous line characters.

Any hint..

thanks
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Texteditor line by line

Post by airsoftsoftwair »

What do you mean by "handle the texteditor line by line"? Do you want to extract a single line of text from a text editor widget?
ilbarbax
Posts: 114
Joined: Thu Apr 01, 2010 6:41 pm

Re: Texteditor line by line

Post by ilbarbax »

Correct, i.e extract line 12 modify and then rewrite back (may be with a different length).
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Texteditor line by line

Post by airsoftsoftwair »

I think it's a TextEditor.mcc limitation. It currently doesn't seem to have a way for getting the absolute character position for a line index and vice versa. Complain here: https://github.com/amiga-mui/texteditor/issues

Of course, it's possible to do this manually by getting Texteditor.Text and then scanning for linefeeds but that's of course a lot of overhead... it should be TextEditor.mcc's job to provide this...
Post Reply