]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/nehe/nehe.factor
pry off some ui app boilerplate with a MAIN-WINDOW: syntax
[factor.git] / extra / nehe / nehe.factor
index 70ab0f0f5da66fa23a9f6839af8be4b40547b237..a4c2aedf23e41425b5448583d83e5c68f4e6cece 100644 (file)
@@ -1,15 +1,13 @@
 USING: ui.gadgets.buttons ui.gadgets.packs ui.gadgets ui
-nehe.2 nehe.3 nehe.4 nehe.5 kernel ;
+nehe.2 nehe.3 nehe.4 nehe.5 kernel accessors ;
 IN: nehe
 
-: nehe-window ( -- )
-    [
-        <filled-pile>
-            "Nehe 2" [ drop run2 ] <border-button> add-gadget
-            "Nehe 3" [ drop run3 ] <border-button> add-gadget
-            "Nehe 4" [ drop run4 ] <border-button> add-gadget
-            "Nehe 5" [ drop run5 ] <border-button> add-gadget
-        "Nehe examples" open-window
-    ] with-ui ;
+MAIN-WINDOW: nehe-window { { title "Nehe Examples" } }
+    <filled-pile>
+        "Nehe 2" [ drop run2 ] <border-button> add-gadget
+        "Nehe 3" [ drop run3 ] <border-button> add-gadget
+        "Nehe 4" [ drop run4 ] <border-button> add-gadget
+        "Nehe 5" [ drop run5 ] <border-button> add-gadget
+        >>gadgets ;
 
 MAIN: nehe-window