JuliaGizmos / Escher.jl

Composable Web UIs in Julia
https://juliagizmos.github.io/Escher.jl
Other
337 stars 63 forks source link

2 Way Code-Mirror #118

Closed dioptre closed 8 years ago

dioptre commented 8 years ago

Hi Mate

The code mirror seems to be broken on the latest, and I was just wanting to make sure this is ok? I'm using it to replicate my own widget...Thanks

inp = Signal(Dict())

s = sampler() # A thing that lets you watch widgets/behaviors upon updates to other behaviors

editor = watch!(s, codemirror("some code", name=:code))
code_cell = trigger!(s, keypress("ctrl+enter shift+enter", editor))

plugsampler(s,
   vbox(
       "My code cell",
       code_cell,
       inp,
   )
) >>> inp

I get

MethodError: convert has no method matching convert(::Type{Escher.Tile}, ::Function) This may have arisen from a call to the constructor Escher.Tile(...), since type constructors fall back to convert methods. Closest candidates are: call{T}(::Type{T}, ::Any) convert(::Type{Escher.Tile}, !Matched::AbstractString) convert(::Type{Escher.Tile}, !Matched::Char)

dioptre commented 8 years ago

I have also tried this: function main(window) push!(window.assets, "codemirror")

inp = Signal(Dict())

s = Escher.sampler()
json = watch!(s, codemirror())
form = sample(s, vbox(json)) >>> inp
consume(data -> hbox(form, string(data)), inp)

end

(youtube example) which results in:

(anonymous function) Dict{Any,Any}()

on page

shashi commented 8 years ago

I believe this is fixed now. Reopen if not.