McRogueFace/tests/snippets/241_Frame.py
John McCardle 07442dd0f0 test(snippets): promote 152 hand-written docs examples into the gated suite
Extends the docs-as-tests pipeline to the hand-written pages. A multi-agent
workflow (tools/wf_docs_rewrite.js) fixed every cookbook/objects/tutorial/
features/templates page against the live 0.2.8-dev API and extracted every
complete runnable example into tests/snippets/131-282, each validated through
_harness.py and stamped by stamp_snippets.py.

run_tests.py already discovers tests/snippets/, so these 152 are now permanently
gated: a future API break that invalidates a documented example fails the suite.
Suite is 282/282; `make check-snippets` clean.
2026-07-15 00:26:38 -04:00

24 lines
643 B
Python

# mcrf: objects=[Caption,Color,Frame,Scene] verified=0.2.8-dev status=ok
import mcrfpy
scene = mcrfpy.Scene("demo")
mcrfpy.current_scene = scene
# Create a styled panel
panel = mcrfpy.Frame(pos=(100, 100), size=(200, 150))
panel.fill_color = mcrfpy.Color(40, 40, 40, 200)
panel.outline_color = mcrfpy.Color(100, 100, 100)
panel.outline = 2
# Add to scene
scene.children.append(panel)
# Frames can contain children
label = mcrfpy.Caption(text="Panel Title", pos=(10, 10))
panel.children.append(label)
# Enable clipping for scrollable content
panel.clip_children = True
# Animate properties
panel.animate("opacity", 0.5, 1.0, "easeInOut")