FTXUI  5.0.0
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...
 
Component Stacked (Components children)
 A list of components to be stacked on top of each other. Events are propagated to the first component, then the second if not handled, etc. The components are drawn in the reverse order they are given. When a component take focus, it is put at the front, without changing the relative order of the other elements. 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,
});
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:317
Examples
examples/component/button.cpp, examples/component/button_in_frame.cpp, examples/component/button_style.cpp, examples/component/checkbox.cpp, examples/component/checkbox_in_frame.cpp, examples/component/collapsible.cpp, examples/component/dropdown.cpp, examples/component/flexbox_gallery.cpp, examples/component/focus.cpp, examples/component/focus_cursor.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input.cpp, examples/component/input_style.cpp, examples/component/linear_gradient_gallery.cpp, examples/component/maybe.cpp, examples/component/menu_entries.cpp, examples/component/menu_entries_animated.cpp, examples/component/menu_multiple.cpp, examples/component/menu_style.cpp, examples/component/menu_underline_animated_gallery.cpp, examples/component/modal_dialog.cpp, examples/component/nested_screen.cpp, examples/component/renderer.cpp, examples/component/slider_rgb.cpp, examples/component/tab_horizontal.cpp, examples/component/toggle.cpp, and examples/component/window.cpp.

Definition at line 317 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 339 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);
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
Definition: container.cpp:360
Examples
examples/component/button.cpp, examples/component/button_animated.cpp, examples/component/button_style.cpp, examples/component/canvas_animated.cpp, examples/component/composition.cpp, examples/component/dropdown.cpp, examples/component/flexbox_gallery.cpp, examples/component/homescreen.cpp, examples/component/input_style.cpp, examples/component/menu2.cpp, examples/component/menu_in_frame_horizontal.cpp, examples/component/menu_multiple.cpp, examples/component/menu_style.cpp, examples/component/modal_dialog_custom.cpp, examples/component/slider_direction.cpp, examples/component/tab_vertical.cpp, and examples/component/with_restored_io.cpp.

Definition at line 360 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 382 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);
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:405
Examples
examples/component/canvas_animated.cpp, examples/component/homescreen.cpp, examples/component/modal_dialog_custom.cpp, examples/component/print_key_press.cpp, examples/component/tab_horizontal.cpp, and examples/component/tab_vertical.cpp.

Definition at line 405 of file container.cpp.

◆ Stacked()

Component Stacked ( Components  children)

A list of components to be stacked on top of each other. Events are propagated to the first component, then the second if not handled, etc. The components are drawn in the reverse order they are given. When a component take focus, it is put at the front, without changing the relative order of the other elements.

This should be used with the Window component.

Parameters
childrenThe list of components.
See also
Window

Example

auto container = Container::Stacked({
children_1,
children_2,
children_3,
children_4,
});
Component Stacked(Components children)
A list of components to be stacked on top of each other. Events are propagated to the first component...
Definition: container.cpp:432
Examples
examples/component/window.cpp.

Definition at line 432 of file container.cpp.