Ho to render table and buttons at the same time #925
Unanswered
StinaRavdna
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to render a hbox with first a vertical box with buttons, and then a vertical box with a table inside. When I run my code the buttons works fine, but the table is not showing. How can I fix this?
My code:
`#include // for shared_ptr, __shared_ptr_access
#include // for operator+, to_string
#include
#include
#include // Add this line to include the vector header
#include // Include this for uint8_t
//#include "arduino_interface.h"
#include "SendRec_Ard.h"
#include "ftxui/dom/elements.hpp" // for separator, gauge, text, Element, operator|, vbox, border
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
#include "ftxui/component/component_base.hpp" // for ComponentBase
#include "ftxui/component/captured_mouse.hpp" // for ftxui
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
#include <ftxui/dom/table.hpp> // for Table, TableSelection
using namespace ftxui;
//Define variables:
int cmd = 0;
int row = 0;
//Define button style:
ButtonOption Style() {
auto option = ButtonOption::Animated();
option.transform = [](const EntryState& s) {
auto element = text(s.label);
if (s.focused) {
element |= bold;
}
return element | center | borderEmpty | flex;
};
return option;
};
int main() {
auto diagnostics_table = Table({
{"INF1:", " - ", "nnn"},
{"INF2:", " - ", "nnn"},
{"INF3:", " - ", "nnn"},
});
}`
Beta Was this translation helpful? Give feedback.
All reactions