]> gitweb.factorcode.org Git - factor.git/commitdiff
use MAIN-WINDOW: in a few places.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 22 Apr 2016 00:00:06 +0000 (17:00 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 22 Apr 2016 00:00:06 +0000 (17:00 -0700)
extra/cairo-demo/cairo-demo.factor
extra/pong/pong.factor
extra/rosetta-code/animate-pendulum/animate-pendulum.factor
extra/rosetta-code/animation/animation.factor
extra/rosetta-code/image-noise/image-noise.factor
extra/rosetta-code/opengl/opengl.factor
extra/trails/trails.factor

index b08729b7a1d8c1b2faf6af50894623667251f10a..81b3b6904da54682900044fc01bf23f9a886f571 100644 (file)
@@ -78,9 +78,6 @@ M: cairo-demo-gadget ungraft* ( gadget -- )
 : <cairo-demo-gadget> ( -- gadget )
     cairo-demo-gadget new ;
 
-: run-cairo-demo ( -- )
-    [
-        <cairo-demo-gadget> "Hello World from Factor!" open-window
-    ] with-ui ;
-
-MAIN: run-cairo-demo
+MAIN-WINDOW: run-cairo-demo
+    { { title "Hello World from Factor!" } }
+    <cairo-demo-gadget> >>gadgets ;
index 4f77e431ff42c22366c4ae043e921c7c6e2dafdd..9939c9fc778830fd8beac7cb35ba2061d37a4f14 100644 (file)
@@ -165,8 +165,6 @@ M:: <pong> draw-gadget* ( PONG -- )
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-: pong-window ( -- ) pong [ "PONG" open-window ] [ start-pong-thread ] bi ;
-
-: pong-main ( -- ) [ pong-window ] with-ui ;
-
-MAIN: pong-window
+MAIN-WINDOW: pong-window
+    { { title "PONG" } }
+    pong [ >>gadgets ] [ start-pong-thread ] bi ;
index 53b94470ee1329b1e8105f590c81d15744109050..5743dfcafc3a73d67dcb6bc7913a6d15d91dca85 100644 (file)
@@ -54,7 +54,6 @@ M: pendulum-gadget ungraft*
     pendulum-gadget new
     { 500 500 } >>pref-dim ;
 
-: pendulum-main ( -- )
-    [ <pendulum-gadget> "pendulum" open-window ] with-ui ;
-
-MAIN: pendulum-main
+MAIN-WINDOW: pendulum-main
+    { { title "pendulum" } }
+    <pendulum-gadget> >>gadgets ;
index f6e2147872e0285a59aaabb5d1e052a29fe5805c..806d201f860281827d1a09be3b6b63ea588e0436 100644 (file)
@@ -46,7 +46,6 @@ M: animated-label graft*
 M: animated-label ungraft*
     alarm>> stop-timer ;
 
-: animated-main ( -- )
-   [ sentence <model> <animated-label> "Rosetta" open-window ] with-ui ;
-
-MAIN: animated-main
+MAIN-WINDOW: animated-main
+    { { title "Rosetta" } }
+    sentence <model> <animated-label> >>gadgets ;
index 72b51662132aa6e265ccc373e5e2ecf1609beb4a..cb4fcdf95279f61b06e18ac9f76c3e3e5aebfb95 100644 (file)
@@ -67,7 +67,6 @@ M: bw-noise-gadget ungraft* [ stop-animation ] [ call-next-method ] bi ;
     [ fps-model>> fps-gadget ]
     [ <pile> swap add-gadget swap add-gadget ] bi ;
 
-: open-noise-window ( -- )
-    [ <bw-noise-gadget> with-fps "Black and White noise" open-window ] with-ui ;
-
-MAIN: open-noise-window
+MAIN-WINDOW: open-noise-window
+    { { title "Black and White noise" } }
+    <bw-noise-gadget> >>gadgets ;
index aad769a31317a482678da34ede216e94706c51ab..498aea074a8bfa06628109eaeef9e35198206352 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (c) 2012 Anonymous
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel math math.rectangles opengl.gl sequences ui
-ui.gadgets ui.render ;
+USING: accessors kernel math math.rectangles opengl.gl
+sequences ui ui.gadgets ui.render ;
 IN: rosetta-code.opengl
 
 ! http://rosettacode.org/wiki/OpenGL
@@ -35,7 +35,6 @@ M: triangle-gadget pref-dim* drop { 640 480 } ;
 M: triangle-gadget draw-gadget*
     rect-bounds nip first2 reshape paint ;
 
-: triangle-window ( -- )
-   [ triangle-gadget new "Triangle" open-window ] with-ui ;
-
-MAIN: triangle-window
+MAIN-WINDOW: triangle-window
+    { { title "Triangle" } }
+    triangle-gadget new >>gadgets ;
index b678899db153fafee5252d8cb911a508ade4300d..8c39597ee0d213e64d5c9f5e3195dbed4583d5f1 100644 (file)
@@ -92,8 +92,6 @@ M:: trails-gadget draw-gadget* ( GADGET -- )
 
   dup start-trails-thread ;
 
-: trails-window ( -- ) [ <trails-gadget> "Trails" open-window ] with-ui ;
-
-! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-MAIN: trails-window
+MAIN-WINDOW: trails-window
+    { { title "Trails" } }
+    <trails-gadget> >>gadgets ;