nanogui: Thread: rewriting texts


[<<] [<] Page 1 of 1 [>] [>>]
Subject: rewriting texts
From: Junior ####@####.####
Date: 14 Jun 2006 22:20:49 +0100
Message-Id: <DCC765AF05C.00000773ejr@inbox.com>

Hi,
I've had this problem before that I work around by rewriting the entire screen and I don't think I should have to do that but I do need someone to point me in the right direction.
On this example I use GrCopyArea and no Expose event except for the initial window creation.

I have a window and on it I display a text, say 15 chars long with a fg and bg colour. Later at that same coordinate, I display a text, 15 chars (10 chars actual text and 5 blank spaces) with the same fg and bg colour.
In this case I expect the new text to overwrite the old text but it does not. Instead it's supperimposed on it. Initially I repaint the screen and write the new text but I don't think that should be necessary.

Is there a way around this problem? 
I think it may be because I'm using GrCopy, but I don't see it acting dfiifernt if I use any other method.

Any ideas?

Thanks.
--Jr
Subject: Re: [nanogui] rewriting texts
From: Pete Klemm ####@####.####
Date: 14 Jun 2006 22:46:02 +0100
Message-Id: <44908395.2080304@esysr.com>

Junior wrote:
> Hi,
> I've had this problem before that I work around by rewriting the entire screen and I don't think I should have to do that but I do need someone to point me in the right direction.
> On this example I use GrCopyArea and no Expose event except for the initial window creation.
>
> I have a window and on it I display a text, say 15 chars long with a fg and bg colour. Later at that same coordinate, I display a text, 15 chars (10 chars actual text and 5 blank spaces) with the same fg and bg colour.
> In this case I expect the new text to overwrite the old text but it does not. Instead it's supperimposed on it. Initially I repaint the screen and write the new text but I don't think that should be necessary.
>   
Did you set the background to opaque?
> Is there a way around this problem? 
> I think it may be because I'm using GrCopy, but I don't see it acting dfiifernt if I use any other method.
>
> Any ideas?
>
> Thanks.
> --Jr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
>
>
>
>   


-- 
_____________________________________________________________________
    ___________   Pete Klemm           Embedded Systems Research,INC
   / __/ __/ _ \  2604 San Mateo Dr.   Software Consultant
  / _/_\ \/ , _/  Plainfield, IL 60586 ####@####.####
 /___/___/_/|_|   Voice: 815-436-4328  http://www.esysr.com
                  Cell:  815-483-3472  Fax: 815-436-4328


Subject: Re: [nanogui] rewriting texts
From: Junior ####@####.####
Date: 14 Jun 2006 22:53:24 +0100
Message-Id: <DD0FAE8AACC.000007B2ejr@inbox.com>

> -----Original Message-----
> From: ####@####.####
> Sent: Wed, 14 Jun 2006 16:45:57 -0500
> To: ####@####.####
> Subject: Re: [nanogui] rewriting texts
> 
> Junior wrote:
>> Hi,
>> I've had this problem before that I work around by rewriting the entire
>> screen and I don't think I should have to do that but I do need someone
>> to point me in the right direction.
>> On this example I use GrCopyArea and no Expose event except for the
>> initial window creation.
>> 
>> I have a window and on it I display a text, say 15 chars long with a fg
>> and bg colour. Later at that same coordinate, I display a text, 15 chars
>> (10 chars actual text and 5 blank spaces) with the same fg and bg
>> colour.
>> In this case I expect the new text to overwrite the old text but it does
>> not. Instead it's supperimposed on it. Initially I repaint the screen
>> and write the new text but I don't think that should be necessary.
>> 
> Did you set the background to opaque?

Background for what? The text? The background of the text could be changed at any time and not that necessarily that of the window background.


>> Is there a way around this problem?
>> I think it may be because I'm using GrCopy, but I don't see it acting
>> dfiifernt if I use any other method.
>> 
>> Any ideas?
>> 
>> Thanks.
>> --Jr
>>

____________________________________________________________
Inbox.com Photos - Share your photos with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!
Subject: Re: [nanogui] rewriting texts
From: Pete Klemm ####@####.####
Date: 14 Jun 2006 23:29:19 +0100
Message-Id: <44908DA6.1090308@esysr.com>

Junior wrote:
>> -----Original Message-----
>> From: ####@####.####
>> Sent: Wed, 14 Jun 2006 16:45:57 -0500
>> To: ####@####.####
>> Subject: Re: [nanogui] rewriting texts
>>
>> Junior wrote:
>>     
>>> Hi,
>>> I've had this problem before that I work around by rewriting the entire
>>> screen and I don't think I should have to do that but I do need someone
>>> to point me in the right direction.
>>> On this example I use GrCopyArea and no Expose event except for the
>>> initial window creation.
>>>
>>> I have a window and on it I display a text, say 15 chars long with a fg
>>> and bg colour. Later at that same coordinate, I display a text, 15 chars
>>> (10 chars actual text and 5 blank spaces) with the same fg and bg
>>> colour.
>>> In this case I expect the new text to overwrite the old text but it does
>>> not. Instead it's supperimposed on it. Initially I repaint the screen
>>> and write the new text but I don't think that should be necessary.
>>>
>>>       
>> Did you set the background to opaque?
>>     
>
> Background for what? The text? The background of the text could be changed at any time and not that necessarily that of the window background.
>
>   
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);

>>> Is there a way around this problem?
>>> I think it may be because I'm using GrCopy, but I don't see it acting
>>> dfiifernt if I use any other method.
>>>
>>> Any ideas?
>>>
>>> Thanks.
>>> --Jr
>>>
>>>       
>
> ____________________________________________________________
> Inbox.com Photos - Share your photos with your friends and family!
> Visit http://www.inbox.com/photosharing to find out more!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
>
>
>
>   


-- 
_____________________________________________________________________
    ___________   Pete Klemm           Embedded Systems Research,INC
   / __/ __/ _ \  2604 San Mateo Dr.   Software Consultant
  / _/_\ \/ , _/  Plainfield, IL 60586 ####@####.####
 /___/___/_/|_|   Voice: 815-436-4328  http://www.esysr.com
                  Cell:  815-483-3472  Fax: 815-436-4328


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.
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.