use MAIN-WINDOW: in a few places.

locals-and-roots
John Benediktsson 2016-04-21 17:00:06 -07:00
parent dbb182d33a
commit c7ca2269b6
7 changed files with 23 additions and 34 deletions

View 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 ;

View 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 ;

View 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 ;

View 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 ;

View 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 ;

View 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 ;

View 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 ;