Code from tutorial at http://ocsigen.org/tuto/manual/tutowidgets