-
This commit is contained in:
27
gui.rkt
27
gui.rkt
@@ -11,6 +11,15 @@
|
||||
|
||||
(define-runtime-path rktplayer-start "rktplayer.html")
|
||||
|
||||
(define-syntax ww-connect
|
||||
(syntax-rules (this)
|
||||
((_ id method)
|
||||
(send (send this element id) connect 'click (λ (data) (send this method)))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(define rktplayer%
|
||||
(class ww-webview%
|
||||
(inherit-field settings)
|
||||
@@ -21,13 +30,9 @@
|
||||
(define/override (html-loaded)
|
||||
(super html-loaded)
|
||||
|
||||
(displayln "html loaded")
|
||||
|
||||
(let* ((play-btn (send this element 'play)))
|
||||
(send play-btn connect 'click
|
||||
(λ (data)
|
||||
(displayln "ja?")
|
||||
(send this play))))
|
||||
(ww-connect 'play play)
|
||||
(ww-connect 'prev previous-track)
|
||||
(ww-connect 'next next-track)
|
||||
|
||||
)
|
||||
|
||||
@@ -35,6 +40,14 @@
|
||||
(displayln "Play button clicked")
|
||||
)
|
||||
|
||||
(define/public (next-track)
|
||||
(displayln "Next track")
|
||||
)
|
||||
|
||||
(define/public (previous-track)
|
||||
(displayln "Previous track")
|
||||
)
|
||||
|
||||
(begin
|
||||
(displayln "RktPlayer started")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user