Skip to content

Commit

Permalink
added a clickable example
Browse files Browse the repository at this point in the history
  • Loading branch information
saikyun committed Aug 1, 2021
1 parent 0482882 commit 194ac09
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions example/clickable.janet
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(import freja/frp)
(import freja/hiccup :as h)
(import freja/events :as e)
(use freja/defonce)

(def props @{:label "Click me"})

(defn hiccup
[props & _]
[:padding {:left 600
:top 30}
[:clickable
{:on-click (fn [_]
(e/put! props :label
(string "Different label " (math/random))))}
(props :label)]])

(setdyn :pretty-format "%.40M")

(h/new-layer :pixel-editor
hiccup
props
:text/size 22)

0 comments on commit 194ac09

Please sign in to comment.