FTXUI  0.8.1
C++ functional terminal UI.
ftxui::Container Namespace Reference

Functions

Component Vertical (Components children)
 A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys. More...
 
Component Vertical (Components children, int *selector)
 A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys. This is useful for implementing a Menu for instance. More...
 
Component Horizontal (Components children)
 A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys. More...
 
Component Horizontal (Components children, int *selector)
 A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys. More...
 
Component Tab (Components children, int *selector)
 A list of components, where only one is drawn and interacted with at a time. The |selector| gives the index of the selected component. This is useful to implement tabs. More...
 

Function Documentation

◆ Vertical() [1/2]

Component Vertical ( Components  children)

A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys.

Parameters
childrenthe list of components.
See also
ContainerBase

Example

auto container = Container::Vertical({
children_1,
children_2,
children_3,
children_4,
});
Examples
examples/component/checkbox.cpp, examples/component/checkbox_in_frame.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input.cpp, examples/component/menu_entries.cpp, examples/component/menu_multiple.cpp, examples/component/nested_screen.cpp, examples/component/renderer.cpp, examples/component/slider_rgb.cpp, examples/component/tab_horizontal.cpp, and examples/component/toggle.cpp.

Definition at line 196 of file container.cpp.

◆ Vertical() [2/2]

Component Vertical ( Components  children,
int *  selector 
)

A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys. This is useful for implementing a Menu for instance.

Parameters
childrenthe list of components.
selectorA reference to the index of the selected children.
See also
ContainerBase

Example

auto container = Container::Vertical({
children_1,
children_2,
children_3,
children_4,
});

Definition at line 218 of file container.cpp.

◆ Horizontal() [1/2]

Component Horizontal ( Components  children)

A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.

Parameters
childrenthe list of components.
See also
ContainerBase

Example

int selected_children = 2;
auto container = Container::Horizontal({
children_1,
children_2,
children_3,
children_4,
}, &selected_children);
Examples
examples/component/button.cpp, examples/component/composition.cpp, examples/component/homescreen.cpp, examples/component/menu2.cpp, examples/component/menu_multiple.cpp, examples/component/menu_style.cpp, examples/component/modal_dialog.cpp, and examples/component/tab_vertical.cpp.

Definition at line 239 of file container.cpp.

◆ Horizontal() [2/2]

Component Horizontal ( Components  children,
int *  selector 
)

A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.

Parameters
childrenthe list of components.
selectorA reference to the index of the selected children.
See also
ContainerBase

Example

int selected_children = 2;
auto container = Container::Horizontal({
children_1,
children_2,
children_3,
children_4,
}, selected_children);

Definition at line 261 of file container.cpp.

◆ Tab()

Component Tab ( Components  children,
int *  selector 
)

A list of components, where only one is drawn and interacted with at a time. The |selector| gives the index of the selected component. This is useful to implement tabs.

Parameters
childrenThe list of components.
selectorThe index of the drawn children.
See also
ContainerBase

Example

int tab_drawn = 0;
auto container = Container::Tab({
children_1,
children_2,
children_3,
children_4,
}, &tab_drawn);
Examples
examples/component/homescreen.cpp, examples/component/modal_dialog.cpp, examples/component/tab_horizontal.cpp, and examples/component/tab_vertical.cpp.

Definition at line 284 of file container.cpp.

ftxui::Container::Horizontal
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
Definition: container.cpp:239
ftxui::Container::Tab
Component Tab(Components children, int *selector)
A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...
Definition: container.cpp:284
ftxui::Container::Vertical
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
Definition: container.cpp:196