]> gitweb.factorcode.org Git - factor.git/commitdiff
progress-bars.models: rename <file-progress-display> to <progress-display>.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 8 Nov 2016 22:14:15 +0000 (14:14 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 8 Nov 2016 22:14:15 +0000 (14:14 -0800)
extra/progress-bars/models/models.factor

index 9ec5a3d31f6d348ab1a35f3104559bb2b4b1085f..4290d2c4401c01d74c0446e9dce8abc5cd2f77e6 100644 (file)
@@ -13,6 +13,11 @@ SYMBOL: progress-bar
 : with-progress-bar ( quot -- )
     [ 0 <model> \ progress-bar ] dip with-variable ; inline
 
+: <progress-display> ( model n -- gadget )
+    [ '[ _ make-progress-bar ] <arrow> <label-control> ] keep
+    [ 0 ] dip make-progress-bar >>string
+    monospace-font >>font ;
+
 SYMBOL: file-size
 
 : update-file-progress ( -- n )
@@ -23,17 +28,12 @@ SYMBOL: file-size
         100 milliseconds sleep file-progress-loop
     ] unless ;
 
-: <file-progress-display> ( model n -- gadget )
-    [ '[ _ make-progress-bar ] <arrow> <label-control> ] keep
-    [ 0 ] dip make-progress-bar >>string
-    monospace-font >>font ;
-
 : with-file-reader-progress ( path encoding quot -- )
     '[
         _ dup file-info size>> file-size set
         _ _ [
             [ file-progress-loop ] "file-reader-progress" spawn drop
-            \ progress-bar get 40 <file-progress-display> gadget. yield
+            \ progress-bar get 40 <progress-display> gadget. yield
         ] prepose
         [ update-file-progress drop ] compose
         with-file-reader