nanogui: rewriting texts
Subject:
Re: [nanogui] rewriting texts
From:
Junior ####@####.####
Date:
15 Jun 2006 20:37:28 +0100
Message-Id: <E87163752B8.0000056Eejr@inbox.com>
> -----Original Message-----
> From: ####@####.####
> Sent: Wed, 14 Jun 2006 17:28:54 -0500
> To: ####@####.####
> Subject: Re: [nanogui] rewriting texts
>
> I had to kluge in the following to overwrite the old text when I was
> displaying a changing temperature.
> Basically, I would fill the foreground with the background color and the
> set everything back.
> It's ugly, but it works.
>
> I'd be interested if there is a better way!
>
> if (_bUseBgColor) {
> GrSetGCForeground(_gcText, _colorTextBg);
> GrFillRect(fl_window, _gcText, x(), y(), w(), h());
> }
>
> GrSetGCForeground(_gcText, _colorText);
> GrSetGCBackground(_gcText, _colorTextBg);
> GrSetGCUseBackground(_gcText, _bUseBgColor ? GR_TRUE : GR_FALSE);
>
Although this method works, let say I have a three sections of the screen with background RED, BLUE and GREEN and I send three text with their coordinates to be displayed. These three text have the same foreground colour and the respective R G B background colour.
So, the text is written and then I want to rewrite these texts with new texts. First I'll have to fill the text area with the area background colour, but if I don't know the coordinates of the areas where the text is to be placed, how do I know what colour to fil it with?
Is there a way to know what the background colour is without keeping track of where the cordinates are with respect to the area I'm drawing into?
I hope you follow this.
Thanks,
--Jr.