Loading...
Searching...
No Matches
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.
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.
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.
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.
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.
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.

## 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

  children | the list of components.

See also
  ContainerBase

### Example

auto container = Container::Vertical({
children_1,
children_2,
children_3,
children_4,
});
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:317
ftxui::Make
std::shared_ptr< T > Make(Args &&... args)
Definition component.hpp:26

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

  children | the list of components.
  selector | A reference to the index of the selected children.

See also
  ContainerBase

### Example

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

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

  children | the list of components.

See also
  ContainerBase

### Example

int selected_children = 2;
auto container = Container::Horizontal({
children_1,
children_2,
children_3,
children_4,
});
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:360

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

  children | the list of components.
  selector | A 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

  children | The list of components.
  selector | The 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);
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:405

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

  children | The list of components.

See also
  Window

### Example

auto container = Container::Stacked({
children_1,
children_2,
children_3,
children_4,
});
ftxui::Container::Stacked
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

Definition at line 432 of file container.cpp.