| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-09-10 23:11:40 -04:00
										 |  |  | USING: kernel alien.c-types combinators namespaces make arrays | 
					
						
							| 
									
										
										
										
											2008-12-18 01:16:43 -05:00
										 |  |  |        sequences splitting | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |        math math.functions math.vectors math.trig | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  |        opengl.gl opengl.glu opengl ui ui.gadgets.slate | 
					
						
							| 
									
										
										
										
											2008-08-01 16:47:35 -04:00
										 |  |  |        vars colors self self.slots | 
					
						
							| 
									
										
										
										
											2008-08-04 22:44:01 -04:00
										 |  |  |        random-weighted colors.hsv cfdg.gl accessors | 
					
						
							| 
									
										
										
										
											2008-09-03 07:05:50 -04:00
										 |  |  |        ui.gadgets.handler ui.gestures assocs ui.gadgets macros | 
					
						
							| 
									
										
										
										
											2008-12-17 19:10:01 -05:00
										 |  |  |        specialized-arrays.double ;
 | 
					
						
							| 
									
										
										
										
											2008-12-03 09:53:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-09-03 07:05:50 -04:00
										 |  |  | QUALIFIED: syntax | 
					
						
							| 
									
										
										
										
											2008-12-03 09:53:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | IN: cfdg | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-01 16:47:35 -04:00
										 |  |  | SELF-SLOTS: hsva | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-11 04:10:41 -05:00
										 |  |  | : clear-color ( color -- ) gl-clear-color GL_COLOR_BUFFER_BIT glClear ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! if (adjustment < 0) | 
					
						
							|  |  |  | !   base + base * adjustment | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ! if (adjustment > 0) | 
					
						
							|  |  |  | !   base + (1 - base) * adjustment | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : adjust ( val num -- val ) dup 0 > [ 1 pick - * + ] [ dupd * + ] if ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-01 16:47:35 -04:00
										 |  |  | : hue ( num -- ) hue-> + 360 mod ->hue ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-01 16:47:35 -04:00
										 |  |  | : saturation ( num -- ) saturation-> swap adjust ->saturation ;
 | 
					
						
							|  |  |  | : brightness ( num -- ) value->      swap adjust ->value ;
 | 
					
						
							|  |  |  | : alpha      ( num -- ) alpha->      swap adjust ->alpha ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-01 16:47:35 -04:00
										 |  |  | : h   ( num -- ) hue ;
 | 
					
						
							|  |  |  | : sat ( num -- ) saturation ;
 | 
					
						
							|  |  |  | : b   ( num -- ) brightness ;
 | 
					
						
							|  |  |  | : a   ( num -- ) alpha ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | VAR: color-stack | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : init-color-stack ( -- ) V{ } clone >color-stack ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-01 16:47:35 -04:00
										 |  |  | : push-color ( -- ) self> color-stack> push   self> clone >self ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-11 04:10:41 -05:00
										 |  |  | : pop-color ( -- ) color-stack> pop dup >self gl-color ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-03 09:53:43 -05:00
										 |  |  | ! : double-nth* ( c-array indices -- seq ) swap [ double-nth ] curry map ; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : double-nth* ( c-array indices -- seq )
 | 
					
						
							|  |  |  |   swap byte-array>double-array [ nth ] curry map ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-18 01:16:43 -05:00
										 |  |  | : check-size ( modelview -- num ) { 0 1 4 5 } double-nth* [ abs ] map supremum ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | VAR: threshold | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  | : iterate? ( -- ? ) get-modelview-matrix check-size threshold> > ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ! cos 2a   sin 2a  0  0 | 
					
						
							|  |  |  | ! sin 2a  -cos 2a  0  0 | 
					
						
							|  |  |  | !      0        0  1  0 | 
					
						
							|  |  |  | !      0        0  0  1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ! column major order | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  | : gl-flip ( angle -- ) deg>rad dup dup dup
 | 
					
						
							|  |  |  |   [ 2 * cos ,   2 * sin ,       0 ,   0 , | 
					
						
							| 
									
										
										
										
											2008-02-02 01:29:47 -05:00
										 |  |  |     2 * sin ,   2 * cos neg ,   0 ,   0 , | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  |           0 ,             0 ,   1 ,   0 ,  | 
					
						
							| 
									
										
										
										
											2008-02-02 01:29:47 -05:00
										 |  |  |           0 ,             0 ,   0 ,   1 , ] | 
					
						
							| 
									
										
										
										
											2008-11-14 21:18:16 -05:00
										 |  |  |   double-array{ } make underlying>> glMultMatrixd ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : circle ( -- )
 | 
					
						
							| 
									
										
										
										
											2008-11-11 04:10:41 -05:00
										 |  |  |   self> gl-color | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  |   gluNewQuadric dup 0 0.5 20 10 gluDisk gluDeleteQuadric ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : triangle ( -- )
 | 
					
						
							| 
									
										
										
										
											2008-11-11 04:10:41 -05:00
										 |  |  |   self> gl-color | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  |   GL_POLYGON glBegin | 
					
						
							|  |  |  |     0    0.577 glVertex2d | 
					
						
							|  |  |  |     0.5 -0.289 glVertex2d | 
					
						
							|  |  |  |    -0.5 -0.289 glVertex2d | 
					
						
							|  |  |  |   glEnd ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : square ( -- )
 | 
					
						
							| 
									
										
										
										
											2008-11-11 04:10:41 -05:00
										 |  |  |   self> gl-color | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  |   GL_POLYGON glBegin | 
					
						
							|  |  |  |     -0.5  0.5 glVertex2d | 
					
						
							|  |  |  |      0.5  0.5 glVertex2d | 
					
						
							|  |  |  |      0.5 -0.5 glVertex2d | 
					
						
							|  |  |  |     -0.5 -0.5 glVertex2d | 
					
						
							|  |  |  |   glEnd ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : size ( scale -- ) dup 1 glScaled ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : size* ( scale-x scale-y -- ) 1 glScaled ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : rotate ( angle -- ) 0 0 1 glRotated ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : x ( x -- ) 0 0 glTranslated ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : y ( y -- ) 0 swap 0 glTranslated ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : flip ( angle -- ) gl-flip ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-01 16:47:35 -04:00
										 |  |  | : s  ( scale -- ) size ;
 | 
					
						
							|  |  |  | : s* ( scale-x scale-y -- ) size* ;
 | 
					
						
							|  |  |  | : r  ( angle -- ) rotate ;
 | 
					
						
							|  |  |  | : f  ( angle -- ) flip ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : do ( quot -- )
 | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  |   push-modelview-matrix | 
					
						
							|  |  |  |   push-color | 
					
						
							|  |  |  |   call
 | 
					
						
							|  |  |  |   pop-modelview-matrix | 
					
						
							|  |  |  |   pop-color ; inline
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:13:14 -04:00
										 |  |  | : recursive ( quot -- ) iterate? swap when ; inline
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : multi ( seq -- ) random-weighted* call ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-06 15:23:09 -04:00
										 |  |  | : [rules] ( seq -- quot )
 | 
					
						
							|  |  |  |   [ unclip swap [ [ do ] curry ] map concat 2array ] map
 | 
					
						
							|  |  |  |   [ call-random-weighted ] swap prefix
 | 
					
						
							|  |  |  |   [ when ] swap prefix
 | 
					
						
							|  |  |  |   [ iterate? ] swap append ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MACRO: rules ( seq -- quot ) [rules] ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : [rule] ( seq -- quot )
 | 
					
						
							|  |  |  |   [ [ do ] swap prefix ] map concat
 | 
					
						
							|  |  |  |   [ when ] swap prefix
 | 
					
						
							|  |  |  |   [ iterate? ] prepend ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MACRO: rule ( seq -- quot ) [rule] ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | VAR: background | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-09-06 03:16:44 -04:00
										 |  |  | : set-initial-background ( -- ) T{ hsva f 0 0 1 1 } clone >self ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : set-background ( -- )
 | 
					
						
							| 
									
										
										
										
											2007-09-29 14:26:51 -04:00
										 |  |  |   set-initial-background | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |   background> call
 | 
					
						
							| 
									
										
										
										
											2008-08-01 16:47:35 -04:00
										 |  |  |   self> clear-color ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | USING: rewrite-closures ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | VAR: viewport ! { left width bottom height } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | VAR: start-shape | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-09-06 03:16:44 -04:00
										 |  |  | : set-initial-color ( -- ) T{ hsva f 0 0 0 1 } clone >self ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:13:14 -04:00
										 |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: dlist | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ! : build-model-dlist ( -- ) | 
					
						
							|  |  |  | !   1 glGenLists dlist set | 
					
						
							|  |  |  | !   dlist get GL_COMPILE_AND_EXECUTE glNewList | 
					
						
							|  |  |  | !   start-shape> call | 
					
						
							|  |  |  | !   glEndList ; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : build-model-dlist ( -- )
 | 
					
						
							|  |  |  |   1 glGenLists dlist set
 | 
					
						
							|  |  |  |   dlist get GL_COMPILE_AND_EXECUTE glNewList | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   set-initial-color | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-11 04:10:41 -05:00
										 |  |  |   self> gl-color | 
					
						
							| 
									
										
										
										
											2008-08-04 22:13:14 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |   start-shape> call
 | 
					
						
							|  |  |  |        | 
					
						
							|  |  |  |   glEndList ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | : display ( -- )
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   GL_PROJECTION glMatrixMode | 
					
						
							|  |  |  |   glLoadIdentity | 
					
						
							|  |  |  |   viewport> first  dup  viewport> second  +
 | 
					
						
							|  |  |  |   viewport> third  dup  viewport> fourth  + gluOrtho2D | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   GL_MODELVIEW glMatrixMode | 
					
						
							|  |  |  |   glLoadIdentity | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   set-background | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   GL_COLOR_BUFFER_BIT glClear | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   init-modelview-matrix-stack | 
					
						
							|  |  |  |   init-color-stack | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:13:14 -04:00
										 |  |  |   dlist get not
 | 
					
						
							|  |  |  |     [ build-model-dlist ] | 
					
						
							|  |  |  |     [ dlist get glCallList ] | 
					
						
							|  |  |  |   if ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:13:14 -04:00
										 |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:44:01 -04:00
										 |  |  | : delete-dlist ( -- ) dlist get [ dlist get 1 glDeleteLists dlist off ] when ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-22 02:21:01 -05:00
										 |  |  | : cfdg-window* ( -- slate )
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:13:14 -04:00
										 |  |  |   C[ display ] <slate> | 
					
						
							| 
									
										
										
										
											2008-08-04 22:44:01 -04:00
										 |  |  |     { 500 500 }       >>pdim | 
					
						
							|  |  |  |     C[ delete-dlist ] >>ungraft | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |   dup "CFDG" open-window ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-11-22 02:21:01 -05:00
										 |  |  | : cfdg-window ( -- slate ) [ cfdg-window* ] with-ui ;
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:13:14 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:44:01 -04:00
										 |  |  | SYMBOL: the-slate | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : rebuild ( -- ) delete-dlist the-slate get relayout-1 ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:13:14 -04:00
										 |  |  | : <cfdg-gadget> ( -- slate )
 | 
					
						
							|  |  |  |   C[ display ] <slate> | 
					
						
							| 
									
										
										
										
											2008-08-04 22:44:01 -04:00
										 |  |  |     dup the-slate set
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:13:14 -04:00
										 |  |  |     { 500 500 } >>pdim | 
					
						
							| 
									
										
										
										
											2008-08-04 22:44:01 -04:00
										 |  |  |     C[ dlist get [ dlist get 1 glDeleteLists ] when ] >>ungraft | 
					
						
							|  |  |  |   <handler> | 
					
						
							|  |  |  |     H{ } clone
 | 
					
						
							| 
									
										
										
										
											2008-09-06 03:16:44 -04:00
										 |  |  |       T{ key-down f f "ENTER" } C[ drop rebuild ] swap pick set-at
 | 
					
						
							| 
									
										
										
										
											2008-09-03 07:05:50 -04:00
										 |  |  |       T{ button-down } C[ drop rebuild ] swap pick set-at
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:44:01 -04:00
										 |  |  |     >>table ;
 | 
					
						
							| 
									
										
										
										
											2008-08-04 22:13:14 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | USE: fry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : cfdg-window. ( quot -- )
 | 
					
						
							|  |  |  |   '[ [ @ <cfdg-gadget> "CFDG" open-window ] with-scope ] with-ui ;
 |