From 875c6826c8875bb20145831d527d35ebbedd5b02 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 26 Oct 2005 01:52:26 +0000 Subject: [PATCH] UI work --- library/collections/slicing.factor | 9 ++++ library/help/tutorial.factor | 2 +- library/opengl/opengl-utils.factor | 2 +- library/styles.factor | 3 -- library/syntax/see.factor | 4 +- library/ui/books.factor | 2 +- library/ui/buttons.factor | 48 +++++++++++++------- library/ui/editors.factor | 3 +- library/ui/labels.factor | 6 +-- library/ui/line-editor.factor | 8 +--- library/ui/listener.factor | 3 +- library/ui/paint.factor | 71 ++++++++++-------------------- library/ui/presentations.factor | 10 ++--- library/ui/sliders.factor | 4 +- library/ui/theme.factor | 44 ++++++++++++++---- 15 files changed, 120 insertions(+), 99 deletions(-) diff --git a/library/collections/slicing.factor b/library/collections/slicing.factor index a2a55cfa35..b468cb3263 100644 --- a/library/collections/slicing.factor +++ b/library/collections/slicing.factor @@ -105,3 +105,12 @@ M: object tail ( index seq -- seq ) [ tail-slice ] keep like ; : drop-prefix ( seq1 seq2 -- seq1 seq2 ) 2dup mismatch dup -1 = [ drop 2dup min-length ] when tuck swap tail-slice >r swap tail-slice r> ; + +IN: strings + +: completion? ( partial completion quot -- ? ) + #! Test if 'partial' is a completion of 'completion', by + #! comparing each "-"-delimited chunk using 'quot'. The + #! quotation is usually either [ subseq? ] or [ swap head? ]. + >r [ "-" split ] 2apply 2dup [ length ] 2apply <= + [ r> 2map [ ] all? ] [ r> 3drop f ] if ; inline diff --git a/library/help/tutorial.factor b/library/help/tutorial.factor index 957676d4e5..93fe46c291 100644 --- a/library/help/tutorial.factor +++ b/library/help/tutorial.factor @@ -373,4 +373,4 @@ M: general-list tutorial-line : "Tutorial"