> I agree that fidget looks like a good starting point. But:

The core rendering engine is the most advanced I think for a native Nim UI, and 
I added a number of small improvements in Fidgetty too. Though it's font 
handling doesn't use the re-written more powerful font handling that pixie now 
offers, which is a bummer. That and handling text input are really big 
impediments.

I believe the immediate mode api just doesn't scale too well. It's easy to hit 
performance issues and as @treeform mentioned it gets really weird handling 
complex state. The developer has to know to call `refresh` 2-3 times to get the 
state to update properly, etc. It's pretty nice for smaller apps but even then 
it's hard to make handling state and callbacks consistent.

However, `pixie` would form a great primitive for a native Nim UI rather than 
skia or cairo. It's not 100% feature comparable but would by and far be the 
best option for drawing the actual primitives. Essentially most big UIs 
something like skia or cairo to rasterize / render things like corners and 
shadows and then modern frameworks use the GPU to actually do the drawing from 
those "textures".

> The implementation of fidgetty is based on a cloned "development" version of 
> fidget. Why? Is there any plan under way to reconcile the two?

I eventually just used a clone of Fidget in Fidgetty for packaging reasons. The 
core design is largely the same, but I added a number of tweaks and 
improvements. I'd say that code would be best to learn from and pick out things 
like the 9-patch rectangles, etc, but not to build directly from it.

> The core widget code (widgets.nim) is completely opaque to me. This may be 
> because I am a newbie as far as macros are concerned, but to me macros are 
> properly used to extend language features (i.e. DSLs) and should be readable 
> in their own terms.

Generally macros are never easy to read without a fair bit of work. ;) There's 
a bit of competition between readable macros and making a DSL robust, etc. That 
said I have found better ways to make such DSL's with less macros. But Fidgetty 
had to hack the immediate mode UI in FIdget to support stateful things. Overall 
I'd recommend a more OO approach for widgets. 

Reply via email to