diff --git a/library/bootstrap/boot-stage3.factor b/library/bootstrap/boot-stage3.factor index de5c4acc18..f4450b7d9a 100644 --- a/library/bootstrap/boot-stage3.factor +++ b/library/bootstrap/boot-stage3.factor @@ -126,6 +126,7 @@ t [ "/library/ui/inspector.factor" "/library/ui/init-world.factor" "/library/ui/tool-menus.factor" + "/library/ui/ui.factor" ] pull-in compile? [ diff --git a/library/ui/editors.factor b/library/ui/editors.factor index f16d56f3f9..326a2f07ab 100644 --- a/library/ui/editors.factor +++ b/library/ui/editors.factor @@ -90,7 +90,7 @@ M: editor user-input* ( ch editor -- ? ) scroll>bottom t ; M: editor pref-size ( editor -- w h ) - editor-text shape-size >r 10 + r> ; + editor-text shape-size >r 1 + r> ; M: editor layout* ( editor -- ) dup editor-caret over caret-size rot resize-gadget diff --git a/library/ui/ui.factor b/library/ui/ui.factor new file mode 100644 index 0000000000..16a5c46e9d --- /dev/null +++ b/library/ui/ui.factor @@ -0,0 +1,29 @@ +! Copyright (C) 2005 Slava Pestov. +! See http://factor.sf.net/license.txt for BSD license. +IN: gadgets +USING: kernel namespaces sdl sequences ; + +: title ( -- str ) + "Factor " version append ; + +SYMBOL: first-time? +global [ first-time? on ] bind + +: first-time ( -- ) + first-time? get [ + world get gadget-paint [ console ] bind + global [ first-time? off ] bind + ] when ; + +IN: shells + +: ui ( -- ) + #! Start the Factor graphics subsystem with the given screen + #! dimensions. + t world get set-world-running? + world get shape-w world get shape-h 0 SDL_RESIZABLE + [ + 0 x set 0 y set [ + title dup SDL_WM_SetCaption first-time run-world + ] with-screen + ] with-scope ; diff --git a/library/ui/world.factor b/library/ui/world.factor index 39c21af5d5..648e3f2ec3 100644 --- a/library/ui/world.factor +++ b/library/ui/world.factor @@ -57,28 +57,3 @@ DEFER: handle-event world get dup [ world-running? ] when [ "UI not running." throw ] unless ; - -: title ( -- str ) - "Factor " version append ; - -IN: shells - -SYMBOL: first-time? -global [ first-time? on ] bind - -: first-time ( -- ) - first-time? get [ - world get gadget-paint [ console ] bind - global [ first-time? off ] bind - ] when ; - -: ui ( -- ) - #! Start the Factor graphics subsystem with the given screen - #! dimensions. - t world get set-world-running? - world get shape-w world get shape-h 0 SDL_RESIZABLE - [ - 0 x set 0 y set [ - title dup SDL_WM_SetCaption first-time run-world - ] with-screen - ] with-scope ;