nanogui: Thread: creating listbox


[<<] [<] Page 1 of 1 [>] [>>]
Subject: creating listbox
From: "Robbie" ####@####.####
Date: 20 Apr 2006 17:08:29 +0100
Message-Id: <20060420160823.5E0C9BD61C@xprdmxin.myway.com>

Hi All,
I'm trying to create listbox with six list items.
I would really like to create a type so I can create a listbox and Be able to change each list background, foreground color as needed.

The problem I'm having is that nanox doesn't seem to let this be accomplished easily. 
If I create a window, It seems like I'll have to create six other windows, all in the previously created one to be able to change the attributes.
Is there a better way to do this I don't know about?

any thoughts or suggestions?

Thanks,
Robbie



_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


Subject: Re: creating listbox
From: "Jordan Crouse" ####@####.####
Date: 20 Apr 2006 17:22:34 +0100
Message-Id: <20060420171511.GB31770@cosmic.amd.com>

On 20/04/06 12:08 -0400, Robbie wrote:
> 
> If I create a window, It seems like I'll have to create six other windows, all in the previously created one to be able to change the attributes.
> Is there a better way to do this I don't know about?

The only time you want to create multiple windows is if you need to monitor
input events seperately for each item.  Otherwise, you should just create one
window, and draw the list items differently.  There are many ways to change
the colors of the drawn items.

For example, you can set the forground and background colors of the 
drawn text, or you can draw a rectangle and then draw the text on top of it.
You can do much of this offscreen and avoid flickering.

Jordan

Subject: [nanogui] Re: creating listbox
From: "Robbie" ####@####.####
Date: 20 Apr 2006 17:35:53 +0100
Message-Id: <20060420163550.7B819BD6FF@xprdmxin.myway.com>

> -----Original Message-----
> From: Jordan Crouse ####@####.####
> Sent: Thursday, April 20, 2006 12:15 PM
> To: Robbie
> Cc: ####@####.####
> Subject: [nanogui] Re: creating listbox
> 
> On 20/04/06 12:08 -0400, Robbie wrote:
> >
> > If I create a window, It seems like I'll have to create six other
> windows, all in the previously created one to be able to change the
> attributes.
> > Is there a better way to do this I don't know about?
> 
> The only time you want to create multiple windows is if you need to
> monitor
> input events seperately for each item.  Otherwise, you should just create
> one
> window, and draw the list items differently.  There are many ways to
> change
> the colors of the drawn items.
> 
> For example, you can set the forground and background colors of the
> drawn text, or you can draw a rectangle and then draw the text on top of
> it.
> You can do much of this offscreen and avoid flickering.
> 
> Jordan
> 

I've tried changing FG and BG of GrText using the GrSetGC(FG/BG) functions on the fonts gc and it didn't have any effect. I tried that multiple times to no success and that's when I thought I'll have to have seperate draw IDs' or windows for each item. All this was done on a single window.


_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


Subject: [nanogui] Re: creating listbox
From: "Robbie" ####@####.####
Date: 20 Apr 2006 18:13:12 +0100
Message-Id: <20060420171259.524F4BD617@xprdmxin.myway.com>



> -----Original Message-----
> From: Robbie ####@####.####
> Sent: Thursday, April 20, 2006 11:36 AM
> To: ####@####.####
> Cc: ####@####.####
> Subject: [nanogui] Re: creating listbox
> 
> 
> > -----Original Message-----
> > From: Jordan Crouse ####@####.####
> > Sent: Thursday, April 20, 2006 12:15 PM
> > To: Robbie
> > Cc: ####@####.####
> > Subject: [nanogui] Re: creating listbox
> >
> > On 20/04/06 12:08 -0400, Robbie wrote:
> > >
> > > If I create a window, It seems like I'll have to create six other
> > windows, all in the previously created one to be able to change the
> > attributes.
> > > Is there a better way to do this I don't know about?
> >
> > The only time you want to create multiple windows is if you need to
> > monitor
> > input events seperately for each item.  Otherwise, you should just
> create
> > one
> > window, and draw the list items differently.  There are many ways to
> > change
> > the colors of the drawn items.
> >
> > For example, you can set the forground and background colors of the
> > drawn text, or you can draw a rectangle and then draw the text on top of
> > it.
> > You can do much of this offscreen and avoid flickering.
> >
> > Jordan
> >
> 
> I've tried changing FG and BG of GrText using the GrSetGC(FG/BG) functions
> on the fonts gc and it didn't have any effect. I tried that multiple times
> to no success and that's when I thought I'll have to have seperate draw
> IDs' or windows for each item. All this was done on a single window.
> 
Jordon.....Also,
The funny thing about RECT is that I can define a rectangle in a window but when I want to draw in that rect, what do I do?

Do I simply draw within the rect area I specify( the real question here is how to specify that region?).

What about Regions? Can that help me or break me?

Thanks,
--Robbie 


_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


Subject: Re: [nanogui] Re: creating listbox
From: "Greg Haerr" ####@####.####
Date: 20 Apr 2006 18:33:17 +0100
Message-Id: <03ff01c664a0$76e8a1a0$0300a8c0@RDP>

: > I've tried changing FG and BG of GrText using the GrSetGC(FG/BG)
functions
: > on the fonts gc and it didn't have any effect. I tried that multiple
times
: > to no success and that's when I thought I'll have to have seperate draw
: > IDs' or windows for each item. All this was done on a single window.

GrsetGCUseBackground must be TRUE of the background
color won't be drawn.  Normally, you'll want to use GrFillRect
to fill a rectangle to your background color before drawing text.

: The funny thing about RECT is that I can define a rectangle in a window
but when I want to draw in that rect, what do I do?

GrFillRect is the fast way to draw a filled rectangle.

You don't need regions, these are sets of rectangles, for complex
shapes.

Regards,

Greg



:
: Do I simply draw within the rect area I specify( the real question here is
how to specify that region?).
:
: What about Regions? Can that help me or break me?
:
: Thanks,
: --Robbie
:
:
: _______________________________________________
: Join Excite! - http://www.excite.com
: The most personalized portal on the Web!
:
:
:
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: ####@####.####
: For additional commands, e-mail: ####@####.####
:
:

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.