Mercurial > gui
comparison 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 |
comparison
equal
deleted
inserted
replaced
13:c016beb0ebac | 14:0827320b0f04 |
---|---|
1 (* A source which can poll for changes and call an action on the new value | |
2 * when one is found. *) | |
3 | |
4 con changePoller :: Type -> Type | |
5 (* The type of pollers over the given type. *) | |
6 | |
7 val create : t ::: Type -> eq t -> t -> transaction (changePoller t) | |
8 (* From an initial value get a poller. *) | |
9 | |
10 val addChangeListener : t ::: Type -> eq t -> (t -> transaction unit) -> int -> changePoller t -> transaction unit | |
11 (* Add an action to run on changed values with a polling period given by the int. *) | |
12 | |
13 val ctl : t ::: Type -> changePoller t -> source t | |
14 (* Get a source to control or set the current value. *) | |
15 | |
16 val value : t ::: Type -> changePoller t -> signal t | |
17 (* A signal holding the current value. *) |