method private select =
let selected s =
match selected with
| Some (child,_) when child==s -> true
| _ -> false
in try
Some (third (List.find
(fun (d,single,s) ->
(* Check single constraints *)
(if selected s then
not single
else
true) &&
(satisfied d) && s.source#is_ready)
children))
with
| Not_found -> None