void TaskBar::update_active(Window active) { for(int n=0; n<children(); n++) { Fl_Widget *w = child(n); Window win = w->argument(); if(GetState(win) == IconicState) w->label_color(fl_inactive(FL_BLACK)); else w->label_color(Fl_Button::default_style->label_color); if(active==win) { TaskBar::active = win; w->set_value(); w->color(fl_lighter(Fl_Button::default_style->color)); w->highlight_color(fl_lighter(Fl_Button::default_style->color)); } else { w->clear_value(); w->color(Fl_Button::default_style->color); w->highlight_color(Fl_Button::default_style->highlight_color); } } redraw(); }
void Fl_Tool_Bar::cb_menu(Fl_Widget *w, void *data) { Fl_Menu_Button *m = (Fl_Menu_Button *)w; Fl_Widget *item = m->item(); if (item && item->user_data()) { Fl_Widget *toolw = (Fl_Widget *)item->user_data(); if(item->value()) toolw->set_value(); else toolw->clear_value(); toolw->do_callback(); } }