mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Added a callback on selection change
This commit is contained in:
committed by
ArthurSonzogni
parent
70a6a04e80
commit
dc70091203
@@ -27,12 +27,18 @@ Element LoremIpsum() {
|
||||
|
||||
int main() {
|
||||
auto screen = ScreenInteractive::TerminalOutput();
|
||||
int counter = 0;
|
||||
|
||||
screen.onSelectionModified([&]{
|
||||
counter++;
|
||||
});
|
||||
|
||||
auto quit = Button("Quit", screen.ExitLoopClosure());
|
||||
|
||||
// The components:
|
||||
auto renderer = Renderer(quit, [&] {
|
||||
return vbox({
|
||||
text("Select: " + std::to_string(counter)),
|
||||
window(text("Horizontal split"), hbox({
|
||||
LoremIpsum(),
|
||||
separator(),
|
||||
|
||||
Reference in New Issue
Block a user