diff --git a/library/sdl/sdl-utils.factor b/library/sdl/sdl-utils.factor index 3f8ecfb1f1..5a82231758 100644 --- a/library/sdl/sdl-utils.factor +++ b/library/sdl/sdl-utils.factor @@ -137,6 +137,7 @@ global [ over str-length 0 = [ 2drop 3drop 0 ] [ + >r >r lookup-font r> r> TTF_RenderUNICODE_Blended [ draw-surface ] keep [ surface-w ] keep diff --git a/library/ui/console.factor b/library/ui/console.factor index bbf1283c92..bd1c9e8857 100644 --- a/library/ui/console.factor +++ b/library/ui/console.factor @@ -342,8 +342,8 @@ M: alien handle-event ( event -- ? ) ] 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 diff --git a/library/ui/fields.factor b/library/ui/fields.factor index 8e394d66e9..73696f2693 100644 --- a/library/ui/fields.factor +++ b/library/ui/fields.factor @@ -11,7 +11,7 @@ TUPLE: editor line delegate ; 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 over set-editor-delegate @@ -34,4 +34,5 @@ C: field ( text -- field ) [[ [ 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 ; diff --git a/library/ui/paint.factor b/library/ui/paint.factor index 960c62d89a..f91433989a 100644 --- a/library/ui/paint.factor +++ b/library/ui/paint.factor @@ -138,6 +138,6 @@ M: string shape-h ( text -- h ) 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 ;