From 70bc39b3fd1495748e9bb54dfa7078858539a9c6 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 25 Mar 2009 11:10:25 -0500 Subject: [PATCH 1/2] Fix hello-unicode for deployment --- extra/hello-unicode/deploy.factor | 15 +++++++++++++++ extra/hello-unicode/hello-unicode.factor | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 extra/hello-unicode/deploy.factor diff --git a/extra/hello-unicode/deploy.factor b/extra/hello-unicode/deploy.factor new file mode 100644 index 0000000000..f2f1c9fb18 --- /dev/null +++ b/extra/hello-unicode/deploy.factor @@ -0,0 +1,15 @@ +USING: tools.deploy.config ; +H{ + { deploy-word-defs? f } + { deploy-reflection 1 } + { deploy-word-props? f } + { deploy-compiler? t } + { deploy-threads? t } + { deploy-unicode? f } + { "stop-after-last-window?" t } + { deploy-name "hello-unicode" } + { deploy-math? t } + { deploy-ui? t } + { deploy-io 2 } + { deploy-c-types? f } +} diff --git a/extra/hello-unicode/hello-unicode.factor b/extra/hello-unicode/hello-unicode.factor index ef492958e7..4374db2003 100644 --- a/extra/hello-unicode/hello-unicode.factor +++ b/extra/hello-unicode/hello-unicode.factor @@ -15,6 +15,6 @@ IN: hello-unicode ] with-style ] make-pane { 10 10 } ; -: hello-unicode ( -- ) "გამარჯობა" open-window ; +: hello-unicode ( -- ) [ "გამარჯობა" open-window ] with-ui ; MAIN: hello-unicode \ No newline at end of file From c36ae80c2824d3387101717cf4c0ba5736eb36c1 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 25 Mar 2009 11:12:10 -0500 Subject: [PATCH 2/2] 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 ]