FLTK logo

RE: [fltk.general] Re: Question about the Fl_Text_Display and Fl_BrowserWidgets

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

RE: Re: Question about the Fl_Text_Display and Fl_BrowserWidgets "MacArthur, Ian \(SELEX\) \(UK\)" Feb 14, 2006  
 
> 	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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.