Constructor arguments instead of init message

This commit is contained in:
mainzelm 2005-05-31 13:40:39 +00:00
parent 8c9d2b7142
commit 43088dafd7
1 changed files with 10 additions and 18 deletions

View File

@ -126,27 +126,19 @@
(select-list-handle-key-press select-list key))
instance))))
(define (make-fsobjects-viewer)
(let ((fs-objects #f)
(buffer #f)
(select-list #f)
(working-dir #f))
(define (make-fsobjects-viewer fs-objects buffer)
(let* ((fs-objects fs-objects)
(buffer buffer)
(working-dir (find-common-parent
(map fs-object-path fs-objects)))
(select-list
(make-file-select-list fs-objects
working-dir
(result-buffer-num-lines buffer))))
(lambda (message)
(cond
((eq? message 'init)
(lambda (self new-fs-objects new-buffer)
(let ((num-lines (result-buffer-num-lines new-buffer))
(parent-dir
(find-common-parent
(map fs-object-path new-fs-objects))))
(set! buffer new-buffer)
(set! fs-objects new-fs-objects)
(set! working-dir parent-dir)
(set! select-list
(make-file-select-list fs-objects parent-dir num-lines))
self)))
((eq? message 'init-browser-for-dir)
(lambda (self new-dir new-buffer)
(with-cwd new-dir