|Text widget to implement a tail command [message #1059613]
||Mon, 20 May 2013 20:06
| Marco Boldi
Registered: May 2013
I'm trying to implement the tail command and show it in a text command limited to 1000 lines, how can I implement such limitation, I think:
1) create an arrayList
2) add each new line to the arrayList
3) if the arrayList dimension is greater than 1000 then, clear the text widget, remove one line from the arraylist (the index 0) and rewrite the text content.
4) if the arraylist dimension is < 1000 then, add the line to the arraylist and the text widget.
What do you think? is there a better way to do this ? , I'm a worried about the performance impact of the step 3.
Powered by FUDForum
. Page generated in 0.02019 seconds