From ebccc4e9a1e6c8b147cab28ca66742c095158702 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 27 Apr 2017 17:39:54 +0200 Subject: [PATCH] simplifications --- uibench/nim_uibench.nim | 56 +++++++++++------------------------------ 1 file changed, 14 insertions(+), 42 deletions(-) diff --git a/uibench/nim_uibench.nim b/uibench/nim_uibench.nim index e1c644b..a9a7d96 100644 --- a/uibench/nim_uibench.nim +++ b/uibench/nim_uibench.nim @@ -29,79 +29,57 @@ type var appState: AppState proc createTableCell(id: cstring): VNode = - kout cstring"createTableCell" proc tableCellClick(ev: karax.Event; n: VNode) = - kout cstring"tableCellClick" kout "Clicked" & id - # ev.stopPropogation() result = buildHtml(td(class="TableCell", onclick=tableCellClick)): text id proc createTableRow(item: TableItemState): VNode = - kout cstring"createTableRow" - var children: seq[VNode] = @[] - children.add createTableCell("#" & &item.id) - for i in 0.." & toJson(samples) & cstring"" - #redraw() - discard + document.body.innerHTML = cstring"
" & toJson(samples) & cstring"
" proc init*(a: cstring, b: cstring) {.importc: "uibench.init", nodecl.} proc run*(a: proc(state: AppState), b: proc(samples: RootRef)) {.importc: "uibench.run", nodecl.} @@ -131,6 +105,4 @@ proc run*(a: proc(state: AppState), b: proc(samples: RootRef)) {.importc: "uiben init(cstring"Nim-karax", cstring"0.6.1") setRendererOnly update -kout cstring"running" - run(a, b) \ No newline at end of file