|
|
> This example shows how to use Fl_Text_Display as a
> 'terminal' of sorts:
> http://seriss.com/people/erco/fltk/#Fltk-tty
>
> Basically, Fl_Text_Display::append() is used to keep appending
> lines to the widget.
>
> But it doesn't show how to limit the scroll buffer; I
> imagine you
> could test the size of the buffer before adding lines, such that
> if it's too large, you can use remove() [and the
> line_xxx() functions]
> to delete lines off the top before append()ing them.
>
> Not sure what kind of memory problems you might run into; try it
> and see.
>
> Fl_Browser works too, but doesn't provide a way for the user
> to highlight individual characters for copy/paste.
I did pretty much this using Fl_Browser in the past - limited the buffer to about 1000 lines, and kept a count of each line I added... Once I got past 1000, for every line I added, I removed line number 1 (and kept my count constant...)
All the management of the lines was left to the browser. Worked.
Would not care to comment on memory fragmentation issues, mind you!
[ Direct Link to Message ] | |
|
| |