Karax: Adding elements

2020-03-06 Thread herdingSheep
How do I add HTML elements at runtime? I am aware of the following example [https://github.com/pragmagic/karax#event-model ](https://github.com/pragmagic/karax#event-model) but I can not convert the example to anything else but a kstring. Manipulating the code ends in failure. What if I wanted

Re: Karax: Adding elements

2020-03-06 Thread jyapayne
You need to use the `VNode` data type in the seq. This is a working example: include karax / prelude var elements: seq[VNode] = @[] proc createDom(): VNode = result = buildHtml(tdiv): button: text "Say hello!" proc onclick(ev: Event;

Re: Karax: Adding elements

2020-03-07 Thread herdingSheep
Thank you @jyapayne. It seems very simple now that I see code that works.