diff --git a/scheme/network-viewer.scm b/scheme/network-viewer.scm new file mode 100644 index 0000000..fcea4d4 --- /dev/null +++ b/scheme/network-viewer.scm @@ -0,0 +1,28 @@ + +(define (make-service-info-viewer service-info buffer) + (let ((service-info service-info) + (select-line (make-select-line + (list + (service-info:name service-info) + ;;(service-info:aliases service-info) + (number->string (service-info:port service-info)) + (service-info:protocol service-info))))) + (lambda (message) + (case message + ((paint) + (lambda (self win buffer have-focus?) + (paint-select-line-at select-line 5 5 win buffer have-focus?))) + ((key-press) + (lambda (self key control-x-pressed?) + (select-line-handle-key-press! select-line key) + self)) + ((get-select-as-text) + (lambda (self for-scheme-mode? focus-object-table) + (select-line-selected-entry select-line))) + ((get-selection-as-ref) + "UII get-selection-as-ref") + (else + (error "service-info-viewer unknown message" message)))))) + +(register-plugin! + (make-view-plugin make-service-info-viewer service-info?)) \ No newline at end of file