[Gambas-user] A question

Rob sourceforge-raindog2 at ...94...
Thu Jan 8 19:33:46 CET 2004


On Thursday 08 January 2004 12:35, ADSILC at ...87... wrote:
> worked very well.  I want to convert a terminal emulation that
> I wrote for windows using vb to Linux.  I was wondering if any
> of the controls support background and foreground color for
> every character within the control.  The first character could

I think your best bet for a terminal app might be the TextLabel 
control:

http://www.binara.com/gambas-wiki/bin/view/GambasTest/GambasComponentQtTextLabel

It's a rich text control implemented using a subset of HTML.  You 
can just make a collection to map control codes to HTML font 
tags, though I'd suggest adding a </font> tag at the end of each 
line for each color change you do.

Alternatively, you might be able to write your own class derived 
from DrawingArea.  This might be cleaner as you wouldn't have to 
keep track of open font tags and I suspect it might be quicker 
to redraw after a scroll.  If you drew a character at a time it 
would even let you use whatever font you wanted since it would 
be forced into monospace by your code.

What control did you use back in the VB days?  I've implemented 
simple terminal emulators using just "Print" and "Cls" but with 
no color support.

Rob





More information about the User mailing list