;; walk the widget tree, applying fn to each widget
(bind-func Widget_walk_preorder
(lambda (widget:Widget* visit_fn:[Widget*,Widget*]*)
(if (null? widget)
widget
(begin
(visit_fn widget)
(Widget_walk_preorder (Widget_left_child widget) visit_fn)
(Widget_walk_preorder (Widget_right_child widget) visit_fn)))))