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

Function topl_set_resp

outdated/sys/mac/macwin.c:1148–1173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1146}
1147
1148void
1149topl_set_resp(char *resp, char def)
1150{
1151 char *loc;
1152 Rect frame;
1153 int r_len, r_len1;
1154
1155 if (!resp) {
1156 const char any_str[2] = { CHAR_ANY, '\0' };
1157 resp = (char *) any_str;
1158 def = CHAR_ANY;
1159 }
1160
1161 SetPortWindowPort(theWindows[WIN_MESSAGE].its_window);
1162 r_len1 = strlen(resp);
1163 r_len = strlen(topl_resp);
1164 if (r_len < r_len1)
1165 r_len = r_len1;
1166 topl_resp_rect(0, &frame);
1167 frame.right = (BTN_IND + BTN_W) * r_len;
1168 InvalWindowRect(theWindows[WIN_MESSAGE].its_window, &frame);
1169
1170 strcpy(topl_resp, resp);
1171 loc = strchr(resp, def);
1172 topl_def_idx = loc ? loc - resp : -1;
1173}
1174
1175static char
1176topl_resp_key(char ch)

Callers 2

mac_display_nhwindowFunction · 0.85
topl_yn_functionFunction · 0.85

Calls 1

topl_resp_rectFunction · 0.85

Tested by

no test coverage detected