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

Function TextUpdate

outdated/sys/mac/macwin.c:2826–2870  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2824}
2825
2826static void
2827TextUpdate(NhWindow *wind)
2828{
2829 Rect r, r2;
2830 RgnHandle h;
2831 Boolean vis;
2832
2833 GetWindowBounds(wind->its_window, kWindowContentRgn, &r);
2834 OffsetRect(&r, -r.left, -r.top);
2835 r2 = r;
2836 r2.left = r2.right - SBARWIDTH;
2837 r2.right += 1;
2838 r2.top -= 1;
2839 vis = (r2.bottom > r2.top + 50);
2840
2841 draw_growicon_vert_only(wind->its_window);
2842 DrawControls(wind->its_window);
2843
2844 h = (RgnHandle) 0;
2845 if (vis && (h = NewRgn())) {
2846 RgnHandle tmp = NewRgn();
2847 if (!tmp) {
2848 DisposeRgn(h);
2849 h = (RgnHandle) 0;
2850 } else {
2851 GetClip(h);
2852 RectRgn(tmp, &r2);
2853 DiffRgn(h, tmp, tmp);
2854 SetClip(tmp);
2855 DisposeRgn(tmp);
2856 }
2857 }
2858 if (r.right < MIN_RIGHT)
2859 r.right = MIN_RIGHT;
2860 r.top -= wind->scrollPos * wind->row_height;
2861 r.right -= SBARWIDTH;
2862 HLock(wind->windowText);
2863 TETextBox(*wind->windowText, wind->windowTextLen, &r, teJustLeft);
2864 HUnlock(wind->windowText);
2865 if (h) {
2866 SetClip(h);
2867 DisposeRgn(h);
2868 }
2869 return;
2870}
2871
2872#if 0 // TARGET_API_MAC_CARBON
2873static pascal OSStatus

Callers 5

MoveScrollBarFunction · 0.85
MenwUpdateFunction · 0.85
TextEventFunction · 0.85
GeneralUpdateFunction · 0.85
HandleUpdateFunction · 0.85

Calls 1

draw_growicon_vert_onlyFunction · 0.85

Tested by

no test coverage detected