addPage

fun addPage(caption: String, content: Actor? = null, icon: Actor? = null, iconSize: Float = 0f, insertBefore: Int = -1, secret: Boolean = false, disabled: Boolean = false, onActivation: (Int, String) -> Unit? = null): Int

Add a page!

Return

The new page's index or -1 if it could not be immediately added (secret).

Parameters

caption

Text to be shown on the header button (automatically translated), can later be used to reference the page in other calls.

content

Actor to show when this page is selected.

icon

Actor, typically an Image, to show before the caption.

iconSize

Size for icon - if not zero, the icon is wrapped to allow a setSize even on Image which ignores size.

insertBefore

-1 to add at the end or index of existing page to insert this before

secret

Marks page as 'secret'. A password is asked once per TabbedPager and if it does not match the has passed in the constructor the page and all subsequent secret pages are dropped.

disabled

Initial disabled state. Disabled pages cannot be selected even with selectPage, their button is dimmed.

onActivation

Optional callback called when this page is shown (per actual change to this page, not per header click). Lambda arguments are page index and caption.

Sources

jvm source
Link copied to clipboard