This was possible in older agar versions where we used to keep a color
table in the widget structure itself, but it was moved to a shared table
as an optimization since nobody really needed the feature at the time.

To allow per-instance color changes, we could add a "color scheme" pointer
to the widget structure, have it point to the shared table by default and
create a private table if a color is changed - I don't like the extra level
of indirection needed though.

Another possible solution would be to allow temporary modifications to the
color scheme (i.e., using a stack of color tables). Then you could have a
container widget's draw() routine do something like

        AG_PushColors();
        AG_SetColor(FOO_COLOR, r,g,b,a);
        AG_WidgetDraw(childWidget);
        AG_PopColors();

A general-purpose "color changing" container widget could be implemented to
simplify the process. People have requested the ability to change fonts on a
per widget basis too - maybe the same method could be applied to fonts?

On Tue, Sep 29, 2009 at 10:03:06PM +0000, Olexandr Sydorchuk wrote:
> No, all widgets rendered by specified style
> See
>   http://libagar.org/mdoc.cgi?man=AG_Intro.3
>   demos/themes/
> 
> ash  writes:
> 
> > Thanks! I gather it is now impossible to change color on one specific 
> > instance 
> > of a widget?
> 
> _______________________________________________
> Agar mailing list
> [email protected]
> http://libagar.org/lists.html
_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

Reply via email to