mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 10:40:00 +08:00
- Added exit button to homescreen example (#819)
This commit is contained in:
parent
f495ce029c
commit
ce5ac6b12f
@ -490,15 +490,24 @@ int main() {
|
||||
},
|
||||
&tab_index);
|
||||
|
||||
auto exit_button = Button(
|
||||
"Exit", [&] { screen.Exit(); }, ButtonOption::Animated());
|
||||
|
||||
auto main_container = Container::Vertical({
|
||||
tab_selection,
|
||||
tab_content,
|
||||
Container::Horizontal({
|
||||
tab_selection,
|
||||
exit_button,
|
||||
}),
|
||||
tab_content,
|
||||
});
|
||||
|
||||
auto main_renderer = Renderer(main_container, [&] {
|
||||
return vbox({
|
||||
text("FTXUI Demo") | bold | hcenter,
|
||||
tab_selection->Render(),
|
||||
hbox({
|
||||
tab_selection->Render() | flex,
|
||||
exit_button->Render(),
|
||||
}),
|
||||
tab_content->Render() | flex,
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user