Mercurial > gui
annotate changePoller.urs @ 14:0827320b0f04
Write calendarCtl in terms of a source with a listener.
author | Karn Kallio <kkallio@eka> |
---|---|
date | Fri, 05 Aug 2011 18:55:24 -0430 |
parents | |
children |
rev | line source |
---|---|
kkallio@14 | 1 (* A source which can poll for changes and call an action on the new value |
kkallio@14 | 2 * when one is found. *) |
kkallio@14 | 3 |
kkallio@14 | 4 con changePoller :: Type -> Type |
kkallio@14 | 5 (* The type of pollers over the given type. *) |
kkallio@14 | 6 |
kkallio@14 | 7 val create : t ::: Type -> eq t -> t -> transaction (changePoller t) |
kkallio@14 | 8 (* From an initial value get a poller. *) |
kkallio@14 | 9 |
kkallio@14 | 10 val addChangeListener : t ::: Type -> eq t -> (t -> transaction unit) -> int -> changePoller t -> transaction unit |
kkallio@14 | 11 (* Add an action to run on changed values with a polling period given by the int. *) |
kkallio@14 | 12 |
kkallio@14 | 13 val ctl : t ::: Type -> changePoller t -> source t |
kkallio@14 | 14 (* Get a source to control or set the current value. *) |
kkallio@14 | 15 |
kkallio@14 | 16 val value : t ::: Type -> changePoller t -> signal t |
kkallio@14 | 17 (* A signal holding the current value. *) |