From 1ad978804c1dced318a1d6e20988b7acc1b4fadb Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 27 Apr 2017 13:47:00 +0200 Subject: [PATCH] fixes --- uibench/nim_uibench.nim | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/uibench/nim_uibench.nim b/uibench/nim_uibench.nim index 4ff4cb3..44da28f 100644 --- a/uibench/nim_uibench.nim +++ b/uibench/nim_uibench.nim @@ -1,25 +1,25 @@ import dom, vdom, karax, karaxdsl, jdict, jstrutils, kajax type - HomeState = object - TableItemState = object + HomeState {.importc.} = ref object + TableItemState {.importc.} = ref object id: int active: bool props: seq[cstring] - TableState = object + TableState {.importc.} = ref object items: seq[TableItemState] - AnimBoxState = object + AnimBoxState {.importc.} = ref object id: int time: int - AnimState = object + AnimState {.importc.} = ref object items: seq[AnimBoxState] - TreeNodeState = object + TreeNodeState {.importc.} = ref object id: int container: bool children: seq[TreeNodeState] - TreeState = object + TreeState {.importc.} = ref object root: TreeNodeState - AppState = object + AppState {.importc.} = ref object location: cstring home: HomeState table: TableState @@ -27,7 +27,7 @@ type tree: TreeState proc init*(a: cstring, b: cstring) {.importc: "uibench.init", nodecl.} -proc run*(a: proc(state: AppState), b: proc(samples: any)) {.importc: "uibench.run", nodecl.} +proc run*(a: proc(state: AppState), b: proc(samples: RootRef)) {.importc: "uibench.run", nodecl.} init(cstring"Nim-karax", cstring"0.6.1") @@ -44,7 +44,7 @@ proc createTableCell(id: cstring): VNode = proc createTableRow(item: TableItemState): VNode = var children = createTableCell("#" & &item.id) - for i in 0..len(item.props): + for i in 0.." & toJson(samples) & cstring"" redraw() +kout cstring"updating" setRenderer update +kout cstring"running" run(a, b) \ No newline at end of file