]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/bunny/bunny.factor
pry off some ui app boilerplate with a MAIN-WINDOW: syntax
[factor.git] / extra / bunny / bunny.factor
index b7400c4acb53e054c7497d95dd2d451b8cc41848..97a90af342bd10ba3e46a67327e8c0973bfe09da 100644 (file)
@@ -44,24 +44,18 @@ M: bunny-world draw-world*
         [ geom>> ] [ get-draw ] bi draw-bunny
     ] if ;
 
-M: bunny-world pref-dim* ( gadget -- dim )
-    drop { 640 480 } ;
-    
 bunny-world H{
     { T{ key-down f f "TAB" } [ next-draw ] }
 } set-gestures
 
-: bunny-window ( -- )
-    [
-        f T{ world-attributes
-            { world-class bunny-world }
-            { title "Bunny" }
-            { pixel-format-attributes {
-                windowed
-                double-buffered
-                T{ depth-bits { value 16 } }
-            } }
-        } open-window
-    ] with-ui ;
-
-MAIN: bunny-window
+MAIN-WINDOW: bunny-window
+    {
+        { world-class bunny-world }
+        { title "Bunny" }
+        { pixel-format-attributes {
+            windowed
+            double-buffered
+            T{ depth-bits { value 16 } }
+        } }
+        { pref-dim { 640 480 } }
+    } ;