The Clarion runtime is chock full of interesting functions, including RegisterEvent which lets you install event handlers for windows and controls. Even better, you can use RegisterEvent not just with procedures but with class methods, which makes it easier to build reusable, testable classes not just for business logic but also for UI logic.