# GUI to edit matrix in Julia?

**URL:** <https://discourse.julialang.org/t/gui-to-edit-matrix-in-julia/48663>\
**Category:** Data\
**Tags:** question, gui\
**Created:** [October 19, 2020, 10:53pm UTC](https://discourse.julialang.org/t/gui-to-edit-matrix-in-julia/48663 "2020-10-19T22:53:24Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [October 20, 2020, 12:37pm UTC](https://discourse.julialang.org/t/gui-to-edit-matrix-in-julia/48663/7 "2020-10-20T12:37:26Z")

</div>

You can definitely use TableView for this, it just needs a bit of plumbing:

```julia
using Blink, TableView
w = Blink.Window();
x = rand(10,10)
function update_cell(arr, msg)
    row = msg["row"] + 1 # zero-indexed in JS
    col = parse(Int, match(r"Column(\d+)", msg["col"])[1])
    arr[row, col] = parse(eltype(arr), msg["new"])
end
body!(w, TableView.showtable(x, cell_changed = msg -> update_cell(x, msg)))

```

This will obviously only work for concretely-typed arrays of numbers, but you can of course adjust it to whatever you want.

Feel free open an issue or PR at [https://github.com/JuliaComputing/TableView.jl](https://github.com/JuliaComputing/TableView.jl) if you have ideas on how to make the whole experience smoother.

Edit: Fixed the row indexing.

---

_[View the full topic](https://discourse.julialang.org/t/gui-to-edit-matrix-in-julia/48663)._
