Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Limit in StyledText - another question
Limit in StyledText - another question [message #438415] Wed, 23 June 2004 19:44 Go to next message
Stan is currently offline StanFriend
Messages: 7
Registered: July 2009
Junior Member
I have a monitoring app that continuously writes whatever it receives in a
StyledText and in a file. But, StyledText has no built-in limit of the
text it contains, as far as I saw from a post on 26.05. Since the app is
intended to be run non-stop, I would really like to find a way to limit
the size of the content in a StyledText.
Re: Limit in StyledText - another question [message #438418 is a reply to message #438415] Wed, 23 June 2004 21:31 Go to previous messageGo to next message
Henning Rogge is currently offline Henning RoggeFriend
Messages: 148
Registered: July 2009
Senior Member
Stan wrote:
> I have a monitoring app that continuously writes whatever it receives in a
> StyledText and in a file. But, StyledText has no built-in limit of the
> text it contains, as far as I saw from a post on 26.05. Since the app is
> intended to be run non-stop, I would really like to find a way to limit
> the size of the content in a StyledText.
>

Just count the number of lines and erase the first one if it grows too much.

Henning Rogge
Re: Limit in StyledText - another question [message #438426 is a reply to message #438418] Wed, 23 June 2004 23:05 Go to previous message
Stan is currently offline StanFriend
Messages: 7
Registered: July 2009
Junior Member
That's the way I was gonna do it. It's just that I didn't know I had to go
through StyledTextContent, and then to figure out why sometimes I would
get an illegal argument exception when using replaceTextRange (because of
splitting CRLF).

So it's all good now.

Henning Rogge wrote:
> Just count the number of lines and erase the first one if it grows too much.
Previous Topic:how to implement owner-drawn items for listbox using swt?
Next Topic:Bug with SWT_AWT on Solaris 8
Goto Forum:
  


Current Time: Fri Apr 26 14:24:17 GMT 2024

Powered by FUDForum. Page generated in 0.03014 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top