|
|
On 2020-11-24 09:15, Rodolfo wrote:
> I'm trying to implement a Fl_Table, as a regular container of widgets, one widget per cell, based on examples/table-as-container.cxx
>
> The cells draw themselves, as explained in the documentation, but I does not respect the background color I selected with cell->color(...) at the time of the cell creation.
>
> Any idea on how to customize the background color of the cells?
What widgets are you using for the cells?
Make sure they have a background, and aren't transparent.
Widgets like Fl_Input have a background, but widgets like Fl_Group, Fl_Box, and Fl_Widget by default use FL_NO_BOX,
which means setting the color() has no effect since the box is transparent. If yours is such a case, be sure to set the
widget's box() type to one of the FL_XXX_BOX values. Note that the FL_XXX_FRAME box types are also see-through;
the only thing they draw is a frame.
The reason for the FL_NO_BOX default is to ensure the default behavior of FLTK is to decrease unnecessary drawing,
as often Fl_Group doesn't need to draw a background (to let the window's background show through), and in the case
of Fl_Box, it's most often used for showing labels, and also don't need their own background.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/fe6cc319-4ae5-7690-a7a5-0a97f0ad95c3%40seriss.com.
[ Direct Link to Message ] | |
|
| |