For all GUI elements, the function
HTk.html#HTk.bindSimplebindSimple provides a
simple way of binding. Its arguments are the GUI element concerned,
and a specification of the kind of events we are interested in:
HTk.html#HTk.WishEventTypeWishEventType is an
algebraic data type describing the kind of event we would like to bind
to, much along the lines of Tk's events:
Each constructor corresponds to a different event, such as
The return value of bind is an event, and an IO action which unbinds the event. You should use this action if you are not interested in the event anymore (i.e. it will not be synchronised on anymore), otherwise there will be a memory leak.