For Programmers: Free Programming Magazines  


Home > Archive > Clarion > January 2006 > Changing the color of strings on the fly









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Changing the color of strings on the fly
peter@petercrowe.co.uk

2006-01-12, 6:55 pm

Hi

Using C5.5EE Ver G

I need to change the colour of 10 pairs of strings on a screen as
events
are streamed into a system and scrolled down the viewing window.
The colour required is dependant on the type of event.

I am using :-
set_color routine
loop pnt_2 = 1 to 10
if inrange(c_event[pnt_2],1,4)
setfont(pnt_2,1,,COLOR:RED)
setfont(pnt_2+10,1,,COLOR:RED)
elsif inrange(c_event[pnt_2],5,7)
setfont(pnt_2,1,,COLOR:FAULT)
setfont(pnt_2+10,1,,COLOR:FAULT)
else
setfont(pnt_2,1,,COLOR:BLUE)
setfont(pnt_2+10,1,,COLOR:BLUE)
end
end

The above is called each time an item is added.
After about 100 items are added and scrolled down the screen the
program
hangs.
If I disable the routine it works fine.

HELP PLEASE

Pete Crowe

Timo Multanen

2006-01-12, 6:55 pm

peter@petercrowe.co.uk wrote:

> Using C5.5EE Ver G


> I am using :-
> set_color routine
> loop pnt_2 = 1 to 10
> if inrange(c_event[pnt_2],1,4)
> setfont(pnt_2,1,,COLOR:RED)


> After about 100 items are added and scrolled down the screen the
> program
> hangs.


Hi Pete,

There is a known memory leak in C5.5's setfont function. As a workaround,
you can set the individual properties of the control such as
PROP:FontColor . Remember to do a display(?Control) after changing a
property.

HTH,
--
Timo
peter@petercrowe.co.uk

2006-01-13, 3:55 am

Hi Timo

This seems to work OK

Many thanks

Pete

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com