USING: kernel namespaces math quotations arrays hashtables sequences threads opengl opengl.gl colors ui ui.gestures ui.gadgets ui.gadgets.slate ui.gadgets.labels ui.gadgets.buttons ui.gadgets.frames ui.gadgets.packs ui.gadgets.grids ui.gadgets.theme ui.gadgets.handler accessors vars fry rewrite-closures automata math.geometry.rect newfx ; IN: automata.ui ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! : draw-point ( y x value -- ) 1 = [ swap glVertex2i ] [ 2drop ] if ; : draw-line ( y line -- ) 0 swap [ [ 2dup ] dip draw-point 1+ ] each 2drop ; : (draw-bitmap) ( bitmap -- ) 0 swap [ [ dup ] dip draw-line 1+ ] each drop ; : draw-bitmap ( bitmap -- ) GL_POINTS glBegin (draw-bitmap) glEnd ; : display ( -- ) black gl-color bitmap> draw-bitmap ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! VAR: slate ! Call a 'model' quotation with the current 'view'. : with-view ( quot -- ) slate> rect-dim first >width slate> rect-dim second >height call slate> relayout-1 ; ! Create a quotation that is appropriate for buttons and gesture handler. : view-action ( quot -- quot ) '[ drop _ with-view ] closed-quot ; : view-button ( label quot -- button ) [