(bind-func toString
(lambda (widget:Widget*)
(let ((s:i8* (salloc 1024)))
(if (null? widget)
(sprintf s "<Widget 0x0>")
(sprintf s
"<Widget %p\n id=%d\n split=%.3f\n type=%lld\n parent=%p\n Lchild=%p\n Rchild=%p\n>"
widget
(Widget_id widget)
(convert (Widget_split widget) double)
(Widget_type widget)
;; (Widget_cb widget) ;; callback
(Widget_parent widget)
(Widget_left_child widget)
(Widget_right_child widget)))
(String s))))