Replies: 2 comments 5 replies
-
I believe a "component" decorator, similar to the "element" decorator is worth doing. That's a good idea! We can also make the "CatchEvent" and "Renderer'" decorator: auto component = component
| CatchEvent('q', screen.QuitClosure())
| CatchEvent('+', [] { count++; }
| CatchEvent('-', [] { count--; }
| CatchEvent(Event::Return, [] { count = 0; }
| Renderer([] (Element e) { return vbox({e, text(count};});
| Renderer(border)
; Do you have other ideas, on top of |
Beta Was this translation helpful? Give feedback.
4 replies
-
and, we could have a decorator version of yeah, this should fall into the category of |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hello, i am wondering if following helper would be useful?
this would allow us to put something like
screen.Loop(document | quit_on_char(screen, 'q'));
i found it's quite handy when adding event handler for a component when developing a complicated interactive application.
if we want to be compatible with older C++ standards, where the concepts are not available, like C++17, we could just drop the constraints, or guard the
requires ...
block usingBeta Was this translation helpful? Give feedback.
All reactions