huda wrote:
> hi every body
>
> I have the same problem with FL_tablebox project which is in download link.
Ian answered this question already.
> I have problem with this method, the color does not change until i move the
> window or click on any widget or in button " warning1" itself
> then the color change to meet the condition how to update directly, I added "
> repeate timeout but also it does not change
You need to add a redraw() call after modifying such widget attributes like
color.
> void MsGnUm(void *) {
>
> // warning1 = (Fl_Button *) b;
>
> if(count1==2 ||count1==1 )
> {
> printf("it is less than 2 ");
>
> warning1->color(fl_color_cube(250*FL_NUM_RED/256,250*FL_NUM_GREEN/256,
> 100*FL_NUM_BLUE/256))
add: warning1->redraw();
>
> }
> else if(count1>2)
> {
> printf("it more than 2 ");
> warning1->color(FL_RED);
add: warning1->redraw();
> }
> else
> {
> printf("it equal than 2 ");
> warning1->color(FL_GREEN);
add: warning1->redraw();
> }
> Fl::repeat_timeout(3.0, MsGnUm, (void*)warning1);
> }
The repeat timeout can be omitted, if you don't need it for
anything else but the redraw() problem above.
Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk