MCPcopy Create free account
hub / github.com/NetHack/NetHack / gnome_add_menu

Function gnome_add_menu

outdated/win/gnome/gnbind.c:708–728  ·  view source on GitHub ↗

add_menu(windid window, int glyph, const anything identifier, char accelerator, char groupacc, int attr, char *str, unsigned int itemflags) -- Add a text line str to the given menu window. If identifier is 0, then the line cannot be selected (e.g. a title). Otherwise, identifier i

Source from the content-addressed store, hash-verified

706 menu is displayed, set bit MENU_ITEMFLAGS_SELECTED.
707*/
708void
709gnome_add_menu(winid wid, int glyph, const ANY_P *identifier,
710 CHAR_P accelerator, CHAR_P group_accel, int attr,
711 const char *str, unsigned int itemflags)
712{
713 boolean presel = ((itemflags & MENU_ITEMFLAGS_SELECTED) != 0);
714 GHackMenuItem item;
715 item.glyph = glyph;
716 item.identifier = identifier;
717 item.accelerator = accelerator;
718 item.group_accel = group_accel;
719 item.attr = attr;
720 item.str = str;
721 item.presel = presel;
722 item.itemflags = itemflags;
723
724 if (wid != -1 && gnome_windowlist[wid].win != NULL) {
725 gtk_signal_emit(GTK_OBJECT(gnome_windowlist[wid].win),
726 ghack_signals[GHSIG_ADD_MENU], &item);
727 }
728}
729
730/*
731end_menu(window, prompt)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected