[file manager] create prototype
This commit is contained in:
commit
493b12219c
|
@ -0,0 +1,7 @@
|
|||
(defsystem magrathea
|
||||
:version "0.0.1"
|
||||
:serial t
|
||||
:license "Unlicense"
|
||||
:author "contrapunctus <contrapunctus at disroot dot org>"
|
||||
:depends-on (:mcclim)
|
||||
:components ((:file "src/file-manager")))
|
|
@ -0,0 +1,33 @@
|
|||
(in-package :cl)
|
||||
|
||||
(defpackage :magrathea.file-manager
|
||||
(:use :clim :clim-lisp)
|
||||
(:import-from :uiop :directory-files)
|
||||
(:export :run-file-manager))
|
||||
|
||||
(in-package :magrathea.file-manager)
|
||||
|
||||
(defclass file ()
|
||||
((path :initarg :pathname :accessor path)))
|
||||
|
||||
(defclass dir (file) nil)
|
||||
|
||||
(define-application-frame file-manager ()
|
||||
((files :initform (directory-files *default-pathname-defaults*)
|
||||
:accessor files))
|
||||
(:pointer-documentation t)
|
||||
(:panes (app :application
|
||||
:display-time t
|
||||
:height 300 :width 600
|
||||
:display-function 'display-files)
|
||||
(int :interactor :height 200 :width 600))
|
||||
(:layouts (default (vertically () app int))))
|
||||
|
||||
(defun display-files (frame pane)
|
||||
(format pane "~{~s~}" (files frame)))
|
||||
|
||||
(define-file-manager-command (com-quit :name t) ()
|
||||
(frame-exit *application-frame*))
|
||||
|
||||
(defun run-file-manager ()
|
||||
(run-frame-top-level (make-application-frame 'file-manager)))
|
Loading…
Reference in New Issue