add: if (item->Target() != NULL) (*item->Target())(menu, item);
context: run_menu(Menu *menu){	sMenuOffset = 0;	menu->Show();	draw_menu(menu);	// Get selected entry, or select the last one, if there is none	int32 selected;	MenuItem *item = menu->FindSelected(&selected);	if (item == NULL) {		selected = menu->CountItems() - 1;		item = menu->ItemAt(selected);		if (item != NULL)			item->Select(true);	}	while (true) {		union key key = wait_for_key();		item = menu->ItemAt(selected);		if (key.code.ascii == 0) {			int32 oldSelected = selected;			switch (key.code.bios) {				case BIOS_KEY_UP:					while ((item = menu->ItemAt(--selected)) != NULL) {						if (item->Type() != MENU_ITEM_SEPARATOR)							break;					}					if (selected < 0)						selected = menu->CountItems() - 1;					break;				case BIOS_KEY_DOWN:					while ((item = menu->ItemAt(++selected)) != NULL) {						if (item->Type() != MENU_ITEM_SEPARATOR)							break;					}					if (selected >= menu->CountItems())						selected = 0;					break;				case BIOS_KEY_PAGE_UP:					selected -= menu_height() - 1;					while ((item = menu->ItemAt(selected)) != NULL) {						if (item->Type() != MENU_ITEM_SEPARATOR)							break;						selected--;					}					if (selected < 0)						selected = 0;					break;				case BIOS_KEY_PAGE_DOWN:					selected += menu_height() - 1;					while ((item = menu->ItemAt(selected)) != NULL) {						if (item->Type() != MENU_ITEM_SEPARATOR)							break;						selected++;					}					if (selected >= menu->CountItems())						selected = menu->CountItems() - 1;					break;				case BIOS_KEY_HOME:					selected = 0;					break;				case BIOS_KEY_END:					selected = menu->CountItems() - 1;					break;			}			// check if selected has changed			if (selected != oldSelected) {				MenuItem *item = menu->ItemAt(selected);				if (item != NULL)					item->Select(true);								// make sure that the new selected entry is visible				if (sMenuOffset > selected					|| sMenuOffset + menu_height() <= selected) {					if (sMenuOffset > selected)						sMenuOffset = selected;					else						sMenuOffset = selected + 1 - menu_height();					draw_menu(menu);				}			}		} else if (key.code.ascii == 0xd || key.code.ascii == ' ') {			// leave the menu			if (item->Submenu() != NULL) {				int32 offset = sMenuOffset;				menu->Hide();				run_menu(item->Submenu());				// restore current menu				sMenuOffset = offset;				menu->Show();				draw_menu(menu);			} else if (item->Type() == MENU_ITEM_MARKABLE) {				// toggle state				item->SetMarked(!item->IsMarked());				print_item_at(selected, item);			} else if (key.code.ascii == 0xd) {				// the space key does not exit the menu				if (menu->Type() == CHOICE_MENU					&& item->Type() != MENU_ITEM_NO_CHOICE					&& item->Type() != MENU_ITEM_TITLE)					item->SetMarked(true);				break;			}		} else if (key.code.ascii == 0x1b && menu->Type() != MAIN_MENU)			// escape key was hit			break;	}	menu->Hide();}