From b7b5d9db0675167f67d6c8494e07c213753c737c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 31 Jul 2025 16:25:58 -0500 Subject: [PATCH] tweak the example to print region bounding box --- ports/m68kmac/code.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/ports/m68kmac/code.py b/ports/m68kmac/code.py index 12187bde93..4b8ed21791 100644 --- a/ports/m68kmac/code.py +++ b/ports/m68kmac/code.py @@ -23,30 +23,15 @@ ev = eventmgr.EventRecord() NIL_WINDOW = uctypes.struct(0, qd.GrafPtr) ABOVE_ALL_WINDOWS = uctypes.struct(-1, qd.GrafPtr) -print(f"{ABOVE_ALL_WINDOWS=}") title = pstr("Hello World 11") r = mactypes.Rect() r[:] = scrn.bounds r.top += 80 +r.left += 100 qd.InsetRect(r, 25, 25) w = windowmgr.NewWindow(NIL_WINDOW, r, title, True, 0, ABOVE_ALL_WINDOWS, True, 0) -print(f"{w=}") -print(f"{w.portRect.left=}") -print(f"{w.portRect.right=}") -# print("before setport") qd.SetPort(w) -# print("33") -# print(type(r)) -# print(r) -# print(f"{w}") -# print(f"{w.portRect}") -# print(f"{w.portRect.top}") -# print(f"{w.portRect.left}") -r[:] = w.portRect -print(r.left, r.right) -print(r.top, r.bottom) - g = qd.qdGlobals() @@ -61,6 +46,8 @@ qd.SetRect(tempRect, 80, 20, 90, 50) qd.FrameOval(tempRect) qd.CloseRgn(barbell) +r[:] = barbell[0].rgnBBox +print(f"region size {barbell[0].rgnSize} bbox {r.top},{r.left}..{r.right},{r.bottom}") qd.FillRgn(barbell, g.black) qd.DisposeRgn(barbell)