] ifte ;
: set-console-font ( font ptsize )
- cons lookup-font dup console-font set
- TTF_FontHeight line-height set ;
+ cons dup console-font set
+ lookup-font TTF_FontHeight line-height set ;
: init-console ( -- )
TTF_Init
editor-line [ line-text get ] bind ;
: set-editor-text ( text editor -- )
- editor-line [ line-text set ] bind ;
+ editor-line [ set-line-text ] bind ;
C: editor ( text -- )
0 0 0 0 <rectangle> <gadget> over set-editor-delegate
[[ [ lose-focus ] [ dup black foreground set-paint-property redraw ] ]]
[[ [ button-down 1 ] [ my-hand request-focus ] ]]
[[ [ "RETURN" ] [ drop "foo!" USE: stdio print ] ]]
+ [[ [ "BACKSPACE" ] [ dup gadget-children car editor-line [ backspace ] bind redraw ] ]]
}} over set-gadget-gestures ;
drop font get lookup-font TTF_FontHeight ;
M: string draw-shape ( text -- )
- >r x get y get font get lookup-font r>
+ >r x get y get font get r>
foreground get 3unlist make-color
draw-string drop ;