Fl_Text_Buffer / Fl_Text_Display removal of lines. How?

14 views
Skip to first unread message

Gonzalo Garramuno

unread,
Nov 10, 2022, 7:22:42 AM11/10/22
to fltkg...@googlegroups.com
How do I remove a line or a set of lines from the beginning of a Fl_Text_Buffer / Fl_Text_Display so as to keep the display under control


Gonzalo Garramuno
ggar...@gmail.com




Ian MacArthur

unread,
Nov 10, 2022, 9:14:42 AM11/10/22
to fltk.general
On Thursday, 10 November 2022 at 12:22:42 UTC Gonzalo wrote:
How do I remove a line or a set of lines from the beginning of a Fl_Text_Buffer / Fl_Text_Display so as to keep the display under control


Hi Gonzalo,

I'm not sure I understood the question... Are you wanting to trim lines off the start of your text buffer, with the intention of stopping it growing too large?

So, you can use  Fl_Text_Buffer::remove (start, end) to cut stuff out, set start = 0 and use  line_start (pos)  to find the start of some line that we can use for end.

Should work at any rate...
Or I'm answering the wrong question?

 

Gonzalo Garramuño

unread,
Nov 10, 2022, 10:12:47 AM11/10/22
to fltkg...@googlegroups.com


El 10/11/2022 a las 11:14 a. m., Ian MacArthur escribió:
On Thursday, 10 November 2022 at 12:22:42 UTC Gonzalo wrote:
How do I remove a line or a set of lines from the beginning of a Fl_Text_Buffer / Fl_Text_Display so as to keep the display under control


Hi Gonzalo,

I'm not sure I understood the question... Are you wanting to trim lines off the start of your text buffer, with the intention of stopping it growing too large?

Yes, that was it.   You nailed it with remove(), line_start(), etc.
Reply all
Reply to author
Forward
0 new messages