mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-28 16:29:34 +08:00
Add "frame" : scrollable area.
This commit is contained in:
@@ -4,7 +4,7 @@ function(example name)
|
||||
endfunction(example)
|
||||
|
||||
example(dbox)
|
||||
example(frame)
|
||||
example(border)
|
||||
example(gauge)
|
||||
example(package_manager)
|
||||
example(separator)
|
||||
|
@@ -15,13 +15,11 @@ int main(int argc, const char *argv[])
|
||||
text(L"Line 1"),
|
||||
text(L"Line 2"),
|
||||
text(L"Line 3"),
|
||||
frame(
|
||||
vbox(
|
||||
text(L"Line 4"),
|
||||
text(L"Line 5"),
|
||||
text(L"Line 6")
|
||||
)
|
||||
),
|
||||
vbox(
|
||||
text(L"Line 4"),
|
||||
text(L"Line 5"),
|
||||
text(L"Line 6")
|
||||
) | border,
|
||||
hbox(
|
||||
window(text(L"frame 2"),
|
||||
vbox(
|
@@ -7,20 +7,14 @@ int main(int argc, const char *argv[])
|
||||
using namespace ftxui;
|
||||
auto document =
|
||||
dbox(
|
||||
frame(
|
||||
vbox(
|
||||
text(L"line_1"),
|
||||
text(L"line_2"),
|
||||
text(L"line_3"),
|
||||
text(L"line_4"),
|
||||
text(L"line_5")
|
||||
)
|
||||
),
|
||||
center(
|
||||
frame(
|
||||
text(L"overlay")
|
||||
)
|
||||
)
|
||||
vbox(
|
||||
text(L"line_1"),
|
||||
text(L"line_2"),
|
||||
text(L"line_3"),
|
||||
text(L"line_4"),
|
||||
text(L"line_5")
|
||||
) | border,
|
||||
text(L"overlay") | border | center
|
||||
);
|
||||
auto screen = Screen::TerminalOutput(document);
|
||||
Render(screen, document.get());
|
||||
|
@@ -24,7 +24,7 @@ int main(int argc, const char *argv[])
|
||||
)
|
||||
);
|
||||
}
|
||||
auto document = hbox(vbox(std::move(entries)) | frame, filler());
|
||||
auto document = hbox(vbox(std::move(entries)) | border, filler());
|
||||
auto screen = Screen::TerminalOutput(document);
|
||||
Render(screen, document.get());
|
||||
std::cout << reset_position << screen.ToString() << std::flush;
|
||||
|
Reference in New Issue
Block a user