-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjson-view.rkt
28 lines (21 loc) · 854 Bytes
/
json-view.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#lang racket/gui
(require breadcrumb
"json-hierlist.rkt"
"node-data.rkt")
(provide json-view%)
(define json-view%
(class vertical-panel%
(super-new)
(define path-bar (new breadcrumb%
[parent this]
[callback (lambda (path)
(send json-hierlist select-path path))]))
(define json-hierlist (new json-hierlist%
[parent this]
[on-item-select (lambda (data)
(send path-bar set-path!
(node-data-path data)))]))
(define/public (get-json)
(send json-hierlist get-json))
(define/public (set-json! jsexpr)
(send json-hierlist set-json! jsexpr))))