refactor: Use property setter pattern for parent assignment

Instead of separate getParent()/setParent()/removeFromParent() methods,
the parent property now supports the Pythonic getter/setter pattern:
- child.parent       # Get parent (or None)
- child.parent = f   # Set parent (adds to f.children)
- child.parent = None # Remove from parent

This matches the existing pattern used by the click property callback.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
John McCardle 2025-11-27 21:01:11 -05:00
commit 41a704a010
4 changed files with 149 additions and 3 deletions

View file

@ -95,6 +95,7 @@ public:
// Python API for parent/global_position
static PyObject* get_parent(PyObject* self, void* closure);
static int set_parent(PyObject* self, PyObject* value, void* closure);
static PyObject* get_global_pos(PyObject* self, void* closure);
// New properties for Phase 1