Congrats @elcritch! It is great to see continuos progress.

I saw this [widgets wanted issue](https://github.com/elcritch/figuro/issues/26) 
and I was wondering if there is a better explanation about how to make them.

Looking at [widget model](https://github.com/elcritch/figuro#widget-model) it 
is a bit unexplained. Here is mix of notes for myself (and others) and doubts 
that I have:

  1. It is clear that widget needs to inherit from `Figuro`. But what is 
`mainRect`'s purpose and why is of type `Figuro`.
  2. Do slots need to have special signature? It looks like the first argument 
is `self: NewWidgetType`, but I don't understand for instance `kind: EventKind` 
in `hover`.
  3. I see that `hasHovered` will be `true` when 
[EventKind](https://github.com/elcritch/figuro/blob/2e146694a58a340ab41829a22b9fcde9bf1d80a6/figuro/inputs.nim#L54-L56)
 is `Enter`. I think some brackets would help the readability to more 
unexperienced programmers like me.
  4. What is the purpose of `refresh(self)`? Is it always needed? If so, could 
`slot` pragma take care of that?
  5. `hoveredAlpha`: it is understood by the code, but a comment at the 
definition would help.
  6. `withDraw` is a template the defines the `parent` and `current` variables 
referring to those widgets. I would say it.
  7. Where are `rectangle`, `box`, `cornerRadius`, `fill`, `darken`, `spin` 
coming from? From pixie?
  8. `button`: it creates 5 buttons. What does `captures` do?
  9. Regarding `connect`, I would state its signature: `Agent, signal, Agent, 
slot`. By the way, `current` and `self` are not the same?
  10. `onHover` is a signal defined 
[here](https://github.com/elcritch/figuro/blob/2e146694a58a340ab41829a22b9fcde9bf1d80a6/figuro/widgets/button.nim#L53).
  11. `var main = Main.new()`: instantiation of the widget.
  12. `connect(main, onDraw, main, Main.draw)`: I understand that `Figuro` 
provides the signal `onDraw` that with connect to the slot `draw` that we just 
defined.
  13. `connect(main, onTick, main, Main.tick)`: where is `onTick` defined?
  14. It is not clear to me where is the appropriate place to `connect`. Could 
those two connection be done before the instantiation?



It looks like the following pattern is used quite often:
    
    
    var main = Main.new()
    connect(main, doDraw, main, Main.draw())
    app.width = 400
    app.height = 140
    startFiguro(main)
    
    
    Run

Maybe it could be simplified? I don't know, maybe a concept for a `Figuro`with 
a `draw` slot?

Reply via email to