Open saikyun opened 1 year ago
The following code for clickable.janet
seems to work [1] with main
(068deb7a3ac1ce405443ebf889b9ed0a643c28e0) ATM:
(import freja/hiccup :as h)
(import freja/event/subscribe :as e)
(use freja/defonce)
(def props @{:label "Click me"})
(defn hiccup
[props & _]
[:padding {:left 600
:top 30}
[:background {:color :white}
[:clickable
{:on-click (fn [_]
(e/put! props :label
(string "Different label " (math/random))))}
(props :label)]]])
(h/new-layer :pixel-editor
hiccup
props
:text/size 22)
[1] Well, at least it doesn't crash and one can click on things with results :)
minimal-hiccup.janet
seems to work for me as-is.
Atm examples are old and don't work. Need to fix that.