From c36ae80c2824d3387101717cf4c0ba5736eb36c1 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 25 Mar 2009 11:12:10 -0500 Subject: [PATCH] Better error message if user forgets with-ui --- basis/ui/gadgets/gadgets.factor | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/basis/ui/gadgets/gadgets.factor b/basis/ui/gadgets/gadgets.factor index e38f56c7f1..a4bedf1ef7 100644 --- a/basis/ui/gadgets/gadgets.factor +++ b/basis/ui/gadgets/gadgets.factor @@ -135,7 +135,9 @@ SYMBOL: ui-notify-flag : forget-pref-dim ( gadget -- ) f >>pref-dim drop ; -: layout-queue ( -- queue ) \ layout-queue get ; +: ui-state ( symbol -- value ) get [ "UI not running" throw ] unless* ; + +: layout-queue ( -- queue ) \ layout-queue ui-state ; : layout-later ( gadget -- ) #! When unit testing gadgets without the UI running, the @@ -214,7 +216,7 @@ M: gadget ungraft* drop ; > graft-queue delete-node ]