From 2aaeb62c4e9d2968c4284c593bc841475f21d6e3 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 2 Apr 2009 01:17:55 -0500 Subject: [PATCH] Fix up 'demos' vocab --- basis/help/tips/tips-docs.factor | 2 ++ extra/demos/demos.factor | 18 ++++++------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/basis/help/tips/tips-docs.factor b/basis/help/tips/tips-docs.factor index 750eff7a52..48ed65b318 100644 --- a/basis/help/tips/tips-docs.factor +++ b/basis/help/tips/tips-docs.factor @@ -20,6 +20,8 @@ TIP: "Power tools: " { $links see edit help about apropos time infer. } ; TIP: "Tips of the day implement the " { $link "definition-protocol" } " and new tips of the day can be defined using the " { $link POSTPONE: TIP: } " parsing word." ; +TIP: "Try some simple demo applications, then look at the source code in " { $snippet "extra/" } ": " { $code "\"demos\" run" } ; + HELP: TIP: { $syntax "TIP: content ;" } { $values { "content" "a markup element" } } diff --git a/extra/demos/demos.factor b/extra/demos/demos.factor index 8c55945105..dfd73f1236 100644 --- a/extra/demos/demos.factor +++ b/extra/demos/demos.factor @@ -1,22 +1,16 @@ - -USING: kernel fry sequences - vocabs.loader help.vocabs - ui ui.gadgets ui.gadgets.buttons ui.gadgets.packs ui.gadgets.scrollers - ui.tools.listener - accessors ; - +USING: kernel fry sequences vocabs.loader help.vocabs ui +ui.gadgets ui.gadgets.buttons ui.gadgets.packs ui.gadgets.borders +ui.gadgets.scrollers ui.tools.listener accessors ; IN: demos : demo-vocabs ( -- seq ) "demos" tagged [ second ] map concat [ name>> ] map ; : ( vocab-name -- button ) - dup '[ drop [ _ run ] call-listener ] ; + dup '[ drop [ _ run ] \ run call-listener ] ; : ( -- gadget ) - 1 >>fill demo-vocabs [ add-gadget ] each ; + 1 >>fill { 2 2 } >>gap demo-vocabs [ add-gadget ] each ; -: demos ( -- ) [ "Demos" open-window ] with-ui ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +: demos ( -- ) [ { 2 2 } "Demos" open-window ] with-ui ; MAIN: demos \ No newline at end of file