コード例 #1
0
// turn the item on if any of its children are on; otherwise restore it
// to its off state.
static void cb_cb(Fl_Widget *w, void *v) {
  Fl_Menu_Item *titleitem = (Fl_Menu_Item*) ((Fl_Menu_ *)w)->mvalue();
  const Fl_Menu_Item *item;
  for (item = titleitem+1; item->label(); item++)
    if (item->value()) {
      titleitem->set();
      return;
    }
  titleitem->clear();
}