Merge commit 'origin/master'
commit
8bd7c51c10
|
@ -21,8 +21,6 @@ M: object normalize-directory ;
|
|||
|
||||
HOOK: normalize-pathname io-backend ( str -- newstr )
|
||||
|
||||
M: object normalize-pathname ;
|
||||
|
||||
: set-io-backend ( io-backend -- )
|
||||
io-backend set-global init-io init-stdio ;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
IN: io.files.tests
|
||||
USING: tools.test io.files io threads kernel continuations io.encodings.ascii
|
||||
io.files.unique sequences strings accessors ;
|
||||
USING: tools.test io.files io threads kernel continuations
|
||||
io.encodings.ascii io.files.unique sequences strings accessors
|
||||
io.encodings.utf8 ;
|
||||
|
||||
[ ] [ "blahblah" temp-file dup exists? [ delete-directory ] [ drop ] if ] unit-test
|
||||
[ ] [ "blahblah" temp-file make-directory ] unit-test
|
||||
|
@ -130,6 +131,18 @@ io.files.unique sequences strings accessors ;
|
|||
|
||||
[ t ] [ cwd "misc" resource-path [ ] with-directory cwd = ] unit-test
|
||||
|
||||
[ t ] [
|
||||
temp-directory [ "hi" "test41" utf8 set-file-contents ] with-directory
|
||||
temp-directory "test41" append-path utf8 file-contents "hi41" =
|
||||
] unit-test
|
||||
|
||||
[ t ] [
|
||||
temp-directory [
|
||||
"test43" utf8 <file-writer> [ "hi43" write ] with-stream
|
||||
] with-directory
|
||||
temp-directory "test43" append-path utf8 file-contents "hi43" =
|
||||
] unit-test
|
||||
|
||||
[ ] [ "append-test" temp-file dup exists? [ delete-file ] [ drop ] if ] unit-test
|
||||
|
||||
[ ] [ "append-test" temp-file ascii <file-appender> dispose ] unit-test
|
||||
|
|
|
@ -272,6 +272,9 @@ DEFER: copy-tree-into
|
|||
|
||||
: temp-file ( name -- path ) temp-directory prepend-path ;
|
||||
|
||||
M: object normalize-pathname ( path -- path' )
|
||||
current-directory get prepend-path ;
|
||||
|
||||
! Pathname presentations
|
||||
TUPLE: pathname string ;
|
||||
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
USING: arrays ui.gadgets
|
||||
ui.gadgets.viewports ui.gadgets.frames ui.gadgets.grids
|
||||
ui.gadgets.theme ui.gadgets.sliders ui.gestures kernel math
|
||||
namespaces sequences models combinators math.vectors ;
|
||||
namespaces sequences models combinators math.vectors
|
||||
tuples ;
|
||||
IN: ui.gadgets.scrollers
|
||||
|
||||
TUPLE: scroller viewport x y follows ;
|
||||
|
||||
: find-scroller ( gadget -- scroller/f )
|
||||
[ scroller? ] find-parent ;
|
||||
[ [ scroller? ] is? ] find-parent ;
|
||||
|
||||
: scroll-up-page scroller-y -1 swap slide-by-page ;
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@ kernel models namespaces parser quotations sequences ui.commands
|
|||
ui.gadgets ui.gadgets.editors ui.gadgets.labelled
|
||||
ui.gadgets.panes ui.gadgets.buttons ui.gadgets.scrollers
|
||||
ui.gadgets.tracks ui.gestures ui.operations vocabs words
|
||||
prettyprint listener debugger threads boxes concurrency.flags ;
|
||||
prettyprint listener debugger threads boxes concurrency.flags
|
||||
math arrays ;
|
||||
IN: ui.tools.listener
|
||||
|
||||
TUPLE: listener-gadget input output stack ;
|
||||
|
@ -23,9 +24,19 @@ TUPLE: listener-gadget input output stack ;
|
|||
: <listener-input> ( listener -- gadget )
|
||||
listener-gadget-output <pane-stream> <interactor> ;
|
||||
|
||||
TUPLE: input-scroller ;
|
||||
|
||||
: <input-scroller> ( interactor -- scroller )
|
||||
<scroller>
|
||||
input-scroller construct-empty
|
||||
[ set-gadget-delegate ] keep ;
|
||||
|
||||
M: input-scroller pref-dim*
|
||||
drop { 0 100 } ;
|
||||
|
||||
: listener-input, ( -- )
|
||||
g <listener-input> g-> set-listener-gadget-input
|
||||
<scroller> "Input" <labelled-gadget> f track, ;
|
||||
<input-scroller> "Input" <labelled-gadget> f track, ;
|
||||
|
||||
: welcome. ( -- )
|
||||
"If this is your first time with Factor, please read the " print
|
||||
|
|
Loading…
Reference in New Issue