TabWidget
classin packageklyn.gui.windows
public class TabWidget extends Container:
└ TabWidget

Closable tab container.

tabs = TabWidget()
tabs.addTab("Welcome", Label("Ready"), false)
tabs.addTab("Query.sql", editor, true)
Properties
Modifier and Type Member Description
public readonly property activeIndex
activeIndex as Int:
Index of the currently visible tab.
public readonly property activeTitle
activeTitle as String:
Title of the selected tab.
public readonly property activeWidget
activeWidget as Widget:
Widget currently hosted by the selected tab, or null when empty.
public property addButtonWidth
addButtonWidth as Int = 34
Width of the optional leading add-tab button.
public property closeAreaWidth
closeAreaWidth as Int = 30
Area reserved at the right of a closeable tab for its close button.
public property showAddButton
showAddButton as Boolean = false
Whether a leading + button is displayed before the tab list.
public property showTabBar
showTabBar as Boolean = true
Whether the tab strip is visible above the active page.
public readonly property size
size as ULong:
Number of tabs.
public property tabHeight
tabHeight as Int = 34
Tab header height in pixels.
Inherited Properties
propertyInherited Properties from Container: autoRelayout, layout, padding
propertyInherited Properties from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, right, sizePolicy, styleClass, width, window, x, y
Events
Modifier and Type Member Description
public event addTabRequested
addTabRequested as ActionEvent
Emitted when the optional leading add-tab button is clicked.
Inherited Events
eventInherited Events from Widget: keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors
Modifier and Type Member Description
public TabWidget Creates an empty tab widget.
Methods
Modifier and Type Member Description
public addTab
addTab(title as String, widget as Widget, closeable as Boolean = true) as Void:
Adds a tab.
public override applyLayout
applyLayout(recursive as Boolean = true) as Void:
No summary.
public closeTab
closeTab(index as Int) as Boolean:
Closes a closeable tab by index.
public findTab
findTab(title as String) as Int:
Returns the index of a tab by title, or -1 when absent.
public onTabClosed
onTabClosed(widget as Widget) as Void:
Hook called after a closeable tab has been removed.
public onTabSelected
onTabSelected(widget as Widget) as Void:
Hook called after a tab becomes active.
public override paint
paint(painter as Painter) as Void:
No summary.
public select
select(index as Int) as Boolean:
Selects a tab by index.
public override setBounds
setBounds(x as Int, y as Int, width as Int, height as Int) as Void:
No summary.
public setTitleAt
setTitleAt(index as Int, title as String) as Boolean:
Updates a tab title without replacing its widget.
public titleAt
titleAt(index as Int) as String:
Returns the tab title at index.
public widgetAt
widgetAt(index as Int) as Widget:
Returns the hosted widget at index, or null when out of range.
Inherited Methods
methodInherited Methods from Container: add, applyLayout, attachWindow, children, clear, paintOverlay, remove, withLayout
methodInherited Methods from Widget: blur, containsPoint, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintOverlay, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds
Inherited Operators
operatorInherited Operators from Container: operator[](index as Int) as Widget:, operator[](index as UInt) as Widget: