TabView
TabView is a container for a set of tab items.
Properties
current-item
(in_out int): The index of the currently active item.current-value
(out TabItem): The current selected tab item.model
(out[TabItem]
): The model of items.enabled
(in bool): True if the list view is enabled.tab-bar-position
(in Position): Defines the position of the tab bar (default top).
Functions
set-current-item(current-item: int)
: Sets the current item by the specified index.
Callbacks
current-item-changed(/* current-item */ int)
: Emitted when the current item has changed because the user modified it.close(/* index */ int)
: Emitted when the the given item is requested to be closed.
Example
import { TabView } from "@coop/lib.slint";
export component Example inherits Window {
width: 150px;
height: 150px;
i-tab-view := TabView {
width: 150px;
height: 150px;
model: [
{ text: "Tab 1" },
{ text: "Tab 2" },
{ text: "Tab 3" },
];
Text {
text: i-tab-view.current-value.text;
}
}
}