b = Button(); hi = function () {print("hi!");} b.onclick(hi);
Output