Package-level declarations

Types

Link copied to clipboard
@Stable
sealed interface ApplicationScope
Link copied to clipboard
@Stable
class DialogState @RememberInComposition constructor(position: WindowPosition = WindowPosition.PlatformDefault, size: Dimension? = null)

A state object that can be hoisted to control and observe a Dialog's geometry.

Link copied to clipboard
sealed interface WindowPosition

Top-left position of a window or dialog on the screen, in raw pixels.

Link copied to clipboard
@Stable
class WindowScope

The receiver of the content of a Window and of a Dialog: the window that content fills.

Link copied to clipboard
@Stable
class WindowState @RememberInComposition constructor(position: WindowPosition = WindowPosition.PlatformDefault, size: Dimension? = null, extendedState: Int = Frame.NORMAL)

A state object that can be hoisted to control and observe a Window's geometry and extended state.

Properties

Link copied to clipboard
val LocalWindow: CompositionLocal<Window?>

The owning AWT Window of the current subtree.

Functions

Link copied to clipboard
fun application(exitProcessOnExit: Boolean = true, content: @Composable ApplicationScope.() -> Unit)

An entry point for the Compose application that blocks the calling thread until the application ends, and by default exits the process. See awaitApplication for more information.

Link copied to clipboard
suspend fun awaitApplication(content: @Composable ApplicationScope.() -> Unit)

An entry point for the Compose application that suspends until the application ends, leaving the thread it was awaited on free.

Link copied to clipboard
@Composable
fun Dialog(onCloseRequest: () -> Unit, state: DialogState = rememberDialogState(), owner: Window? = null, title: @Nls String = "", modality: Dialog.ModalityType = Dialog.ModalityType.MODELESS, visible: Boolean = true, resizable: Boolean = true, alwaysOnTop: Boolean = false, iconImage: Image? = null, minimumSize: Dimension? = null, undecorated: Boolean = false, content: @Composable WindowScope.() -> Unit)

A dialog window, realized as a JDialog: it shows content, holds its geometry in state, blocks input to the top-level windows in its modality's scope of blocking, and reports the user's attempt to close it to onCloseRequest.

Link copied to clipboard
@Composable
fun WindowScope.GlassPane(content: @Composable () -> Unit)

Declares the glass pane of the window whose content this is composed in.

Link copied to clipboard
fun CoroutineScope.launchApplication(content: @Composable ApplicationScope.() -> Unit): Job

Short variant of launching an application inside a CoroutineScope.

Link copied to clipboard
@Composable
fun WindowScope.MenuBar(content: @Composable () -> Unit)

Declares the menu bar of the window whose content this is composed in.

Link copied to clipboard
@Composable
fun rememberDialogState(position: WindowPosition = WindowPosition.PlatformDefault, size: Dimension? = null): DialogState

Creates a DialogState that is remembered across compositions.

Link copied to clipboard
@Composable
fun rememberWindowState(position: WindowPosition = WindowPosition.PlatformDefault, size: Dimension? = null, extendedState: Int = Frame.NORMAL): WindowState

Creates a WindowState that is remembered across compositions.

Link copied to clipboard
@Composable
fun Window(onCloseRequest: () -> Unit, state: WindowState = rememberWindowState(), title: @Nls String = "", visible: Boolean = true, resizable: Boolean = true, alwaysOnTop: Boolean = false, iconImage: Image? = null, minimumSize: Dimension? = null, undecorated: Boolean = false, content: @Composable WindowScope.() -> Unit)

A top-level application window, realized as a JFrame: it shows content, holds its geometry and extended state in state, and reports the user's attempt to close it to onCloseRequest.