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

Function find_widget

win/X11/winX.c:253–272  ·  view source on GitHub ↗

* Find the window structure that corresponds to the given widget. Note * that this is not the popup widget, nor the viewport, but the child. */

Source from the content-addressed store, hash-verified

251 * that this is not the popup widget, nor the viewport, but the child.
252 */
253struct xwindow *
254find_widget(Widget w)
255{
256 int windex;
257 struct xwindow *wp;
258
259 /*
260 * Search to find the corresponding window. Look at the main widget,
261 * popup, the parent of the main widget, then parent of the widget.
262 */
263 for (windex = 0, wp = window_list; windex < MAX_WINDOWS; windex++, wp++)
264 if (wp->type != NHW_NONE && (wp->w == w || wp->popup == w
265 || (wp->w && (XtParent(wp->w)) == w)
266 || (wp->popup == XtParent(w))))
267 break;
268
269 if (windex == MAX_WINDOWS)
270 panic("find_widget: can't match widget");
271 return wp;
272}
273
274/*
275 * Find a free window slot for use.

Callers 8

menu_deleteFunction · 0.85
menu_keyFunction · 0.85
mesg_exposedFunction · 0.85
mesg_resizedFunction · 0.85
delete_textFunction · 0.85
dismiss_textFunction · 0.85
set_button_valuesFunction · 0.85
map_exposedFunction · 0.85

Calls 1

panicFunction · 0.50

Tested by

no test coverage detected