From 0af3cbee16a2c4a48e33bff6b60ed17c52c021da Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 28 Sep 2016 05:07:50 -0400 Subject: [PATCH] Make layout-driver commit to a single kind of layout per request --- gui.rkt | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gui.rkt b/gui.rkt index b88a01c..7fbf495 100644 --- a/gui.rkt +++ b/gui.rkt @@ -126,15 +126,14 @@ (if (number? v) (exact->inexact v) v)) (actor #:name 'layout-driver - (during/actor (observe (layout-solution $container-id (horizontal-layout _) _ _)) - #:name (list 'horizontal-layout container-id) - (solve-hv-layout #f container-id)) - (during/actor (observe (layout-solution $container-id (vertical-layout _) _ _)) - #:name (list 'vertical-layout container-id) - (solve-hv-layout #t container-id)) - (during/actor (observe (layout-solution $container-id (tabular-layout _ _) _ _)) - #:name (list 'tabular-layout container-id) - (solve-tabular-layout container-id))) + (during/actor (observe (layout-solution $container-id _ _ _)) + #:name (list 'layout container-id) + (stop-when (asserted (observe (layout-solution container-id (horizontal-layout _) _ _))) + (react (solve-hv-layout #f container-id))) + (stop-when (asserted (observe (layout-solution container-id (vertical-layout _) _ _))) + (react (solve-hv-layout #t container-id))) + (stop-when (asserted (observe (layout-solution container-id (tabular-layout _ _) _ _))) + (react (solve-tabular-layout container-id))))) (define (solve-hv-layout vertical? container-id) (define ctor (if vertical? vertical-layout horizontal-layout))