commander-s/scheme/network-viewer.scm

28 lines
1.1 KiB
Scheme
Raw Normal View History

2005-09-27 12:20:57 -04:00
(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?))