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

Function done_button

win/X11/winX.c:1920–1943  ·  view source on GitHub ↗

Callback for getline dialog widget. */ ARGSUSED */

Source from the content-addressed store, hash-verified

1918/* Callback for getline dialog widget. */
1919/* ARGSUSED */
1920static void
1921done_button(Widget w, XtPointer client_data, XtPointer call_data)
1922{
1923 int len;
1924 char *s;
1925 Widget dialog = (Widget) client_data;
1926
1927 nhUse(w);
1928 nhUse(call_data);
1929
1930 s = (char *) GetDialogResponse(dialog);
1931 len = strlen(s);
1932
1933 /* Truncate input if necessary */
1934 if (len >= BUFSZ)
1935 len = BUFSZ - 1;
1936
1937 (void) strncpy(getline_input, s, len);
1938 getline_input[len] = '\0';
1939 XtFree(s);
1940
1941 nh_XtPopdown(XtParent(dialog));
1942 exit_x_event = TRUE;
1943}
1944
1945/* ARGSUSED */
1946static void

Callers

nothing calls this directly

Calls 2

GetDialogResponseFunction · 0.85
nh_XtPopdownFunction · 0.85

Tested by

no test coverage detected