DesktopPaneScope

sealed interface DesktopPaneScope

The receiver of a DesktopPane's content, through which a frame floating on that desktop is declared. Each InternalFrame call declares one frame, in call order, and a frame is the only child a desktop takes: anything else composed in the content names no place on the desktop and is refused.

A frame keeps the JInternalFrame it was realized as - and with it everything the user has done to that frame - for as long as the composition goes on declaring it in the same place: a frame declared at a place of its own keeps its window however the frames declared around it come and go. Frames declared from one place, as a loop over a list declares them, are told apart by the position they are declared in, so wrap each in androidx.compose.runtime.key to give it an identity of its own; the frames declared after a removed one then stay the frames the user left behind.

One InternalFrameState drives one frame: a state driving two frames at once would receive both frames' write-backs, each undoing what the other's user interaction just wrote, so the second frame to take a state stops the composition instead.

See also

Functions

Link copied to clipboard
@Composable
abstract fun InternalFrame(title: @Nls String, bounds: Rectangle, internalFrameListener: InternalFrameListener, modifier: SwingModifier = SwingModifier, controls: InternalFrameControls = InternalFrameControls(), content: @Composable () -> Unit)

Declares one internal frame driven by a raw InternalFrameListener instead of an onClose lambda. The internalFrameListener is attached as-is and removed on the same instance; pass a stable instance (e.g. remember {}) to avoid churn. Use this overload to observe the full set of internal-frame events (opened, closing, closed, iconified, deiconified, activated, deactivated); the close control stays controlled, so remove the frame from the composition to actually close it.

@Composable
abstract fun InternalFrame(title: @Nls String, bounds: Rectangle, onClose: () -> Unit, modifier: SwingModifier = SwingModifier, controls: InternalFrameControls = InternalFrameControls(), content: @Composable () -> Unit)

Declares one internal frame, placed on plain bounds.

@Composable
abstract fun InternalFrame(title: @Nls String, state: InternalFrameState, internalFrameListener: InternalFrameListener, modifier: SwingModifier = SwingModifier, controls: InternalFrameControls = InternalFrameControls(), content: @Composable () -> Unit)

Declares one internal frame whose geometry and window state are driven by the hoisted state, and whose window events reach a raw InternalFrameListener instead of an onClose lambda. The internalFrameListener is attached as-is and removed on the same instance; pass a stable instance (e.g. remember {}) to avoid churn.

@Composable
abstract fun InternalFrame(title: @Nls String, state: InternalFrameState, onClose: () -> Unit, modifier: SwingModifier = SwingModifier, controls: InternalFrameControls = InternalFrameControls(), content: @Composable () -> Unit)

Declares one internal frame whose geometry and window state are driven by the hoisted state. Assigning to InternalFrameState.bounds moves and resizes the frame, assigning to InternalFrameState.iconified iconifies or deiconifies it and assigning to InternalFrameState.maximized maximizes or restores it, and a user dragging its title bar, pulling its border or activating its iconify, maximize or restore control writes the new value back into state.