GlassPane

@Composable
abstract fun GlassPane(modifier: SwingModifier = SwingModifier, content: @Composable PanelScope.() -> Unit)

Shows the layer's own glass pane over the view, holding content under the pane's own FlowLayout: a PanelLayout.Flow with its defaults.

Parameters

modifier

the SwingModifier applied to the glass pane

content

the composable content the glass pane shows over the view

See also


@Composable
abstract fun <S : PanelScope> GlassPane(layout: PanelLayout<S>, modifier: SwingModifier = SwingModifier, content: @Composable S.() -> Unit)

Shows the layer's own glass pane over the view, holding content under layout.

The pane covers the layer, it is transparent where content paints nothing, and it paints after the view, so an overlay declared here is drawn over the wrapped component. A mouse event goes to the deepest component under the pointer that listens for it, and goes on to the view otherwise. modifier reaches the pane itself: a veil's background, a wait cursor, a mouse listener that keeps the mouse from the view.

This is composed directly in the layer's content. The pane is shown for as long as this is in the composition, whatever visibility modifier declares. Once this leaves, every property modifier declared is given back, the pane is hidden again and the children content composed are removed; layout stays installed on the pane. An overlay that comes and goes is an ordinary if around the call, and an if/else that selects one of two declarations keeps the pane shown and applies the selected one. A layer has one glass pane, so two declarations composed in the same layer at once are refused.

Parameters

layout

the layout the pane's children are laid out under; see PanelLayout

modifier

the SwingModifier applied to the glass pane

content

the composable content the glass pane shows over the view, with layout's scope as its receiver

See also