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

Function MsgClick

outdated/sys/mac/macwin.c:2327–2359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2325 */
2326
2327static void
2328MsgClick(NhWindow *wind, Point pt)
2329{
2330 int r_idx = 0;
2331
2332 while (topl_resp[r_idx]) {
2333 Rect frame;
2334 topl_resp_rect(r_idx, &frame);
2335 InsetRect(&frame, 1, 1);
2336 if (PtInRect(pt, &frame)) {
2337 Boolean in_btn = true;
2338
2339 InvertRect(&frame);
2340 while (WaitMouseUp()) {
2341#if !TARGET_API_MAC_CARBON
2342 SystemTask();
2343#endif
2344 GetMouse(&pt);
2345 if (PtInRect(pt, &frame) != in_btn) {
2346 in_btn = !in_btn;
2347 InvertRect(&frame);
2348 }
2349 }
2350 if (in_btn) {
2351 InvertRect(&frame);
2352 AddToKeyQueue(topl_resp[r_idx], 1);
2353 }
2354 return;
2355 }
2356 ++r_idx;
2357 }
2358 return;
2359}
2360
2361static void
2362MsgUpdate(NhWindow *wind)

Callers 2

MsgEventFunction · 0.85
macClickMessageFunction · 0.85

Calls 2

topl_resp_rectFunction · 0.85
AddToKeyQueueFunction · 0.85

Tested by

no test coverage detected