[XForms] Setting FL_CHOICE colors.

Angus Leeming angus.leeming at btopenworld.com
Mon Jun 21 16:56:33 EDT 2004


On Monday 21 June 2004 7:56 pm, jason cipriani wrote:
> To subscribers of the xforms list
>
>
> How do you set the color of the text of the items in the dropdown
> box that appears when you click on an FL_NORMAL_CHOICE2?
>
> The color of the label, and the color of the title in this dropdown
> box is obj->lcolor. The color of the text inside the choice box is
> obj->col2. But I can't figure out which one is the color of the
> items in the box.

Jason,

the list is a popup. (See xpopup.c.) The code used to draw it in 
choice.c is to be found in do_pup.

Anyway, I think the magic line of code you're looking for is to be 
found about line 120 in xpopup.c:

static FL_COLOR pupcolor = FL_COL1, puptcolor = FL_BLACK;

Followed by line 480:
void
fl_setpup_default_color(FL_COLOR fg, FL_COLOR bg)
{
    pupcolor = fg;
    puptcolor = bg;
}

> Also, the color of the text in a browser is obj->lcolor, yet the
> style of the text in the browser is not obj->lstyle/obj->lsize.
> This is both inconsistent with itself and with FL_CHOICE, where the
> text color is obj->col2. This is all undocumented. Does anybody
> know why this is so patchy?

I suspect it is because the original driving force behind the code 
development was waning somewhat by the time these widgets came to be 
written.

Hope this helps,
Angus



More information about the Xforms mailing list