Can anyone tell me, how to change the background color of Fl_Window by pressing Fl_Button. I'm trying to do it this way but it's not working.
void new_color(Fl_Widget* w, void*){
Fl_Button* b = (Fl_Button*)w;
b->parent()->color(FL_RED);
}
int main()
}
Fl_Window* win = new Fl_Window(...);
win->color(FL_WHITE);
win->begin();
Fl_Button* but = new Fl_Button(...);
but->callback(new_color);
win->end();
...
}
thanks!!!
As pointed by cup, redraw does the trick: