FileSelectionBox.st
changeset 44 f5e3a267fe4e
parent 41 2f8d0f8e796b
child 59 450ce95a72a4
--- a/FileSelectionBox.st	Fri Aug 12 01:46:28 1994 +0200
+++ b/FileSelectionBox.st	Fri Aug 12 01:47:09 1994 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1990 by Claus Gittinger
               All Rights Reserved
 
-$Header: /cvs/stx/stx/libwidg/FileSelectionBox.st,v 1.8 1994-08-07 20:49:39 claus Exp $
+$Header: /cvs/stx/stx/libwidg/FileSelectionBox.st,v 1.9 1994-08-11 23:47:09 claus Exp $
 '!
 
 !FileSelectionBox class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg/FileSelectionBox.st,v 1.8 1994-08-07 20:49:39 claus Exp $
+$Header: /cvs/stx/stx/libwidg/FileSelectionBox.st,v 1.9 1994-08-11 23:47:09 claus Exp $
 "
 !
 
@@ -92,6 +92,15 @@
         box pattern:'*'.
         box matchBlock:[:name | name first isLowercase].
         box open
+
+    Example5:
+
+        |box|
+        box := FileSelectionBox new.
+        box title:'Which directory ?'.
+        box pattern:'l*'.
+        box matchBlock:[:name | OperatingSystem isDirectory:name].
+        box open
 "
 ! !
 
@@ -250,9 +259,17 @@
 matchBlock:aBlock
     "set the matchBlock (in the selectionList). Only files
      for which the block returns true are shown.
-     This matching is actually done in the fileSeelctionList."
+     The matching is actually done in the fileSelectionList,
+     but we trick a bit to pass the full pathname instead of the
+     selection-name to the block."
 
-    selectionList matchBlock:aBlock
+    selectionList matchBlock:[:name | 
+        |dir fullPath|
+
+        dir := selectionList directory pathName asFilename.
+        fullPath := dir construct:name. 
+        aBlock value:fullPath asString
+    ]
 !
 
 contents