B bis
06/14/2021, 12:07 PMjim
06/14/2021, 3:57 PMIgor Demin
06/15/2021, 1:39 PMimport androidx.compose.desktop.ComposeWindow
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import java.awt.Dimension
import java.awt.event.WindowAdapter
import java.awt.event.WindowEvent
@OptIn(ExperimentalComposeUiApi::class)
fun main() = application {
var isOpen by remember { mutableStateOf(true) }
if (isOpen) {
Window(
create = {
ComposeWindow().apply {
size = Dimension(600, 600)
minimumSize = Dimension(400, 400)
addWindowListener(object : WindowAdapter() {
override fun windowClosing(e: WindowEvent?) {
isOpen = false
}
})
}
},
dispose = ComposeWindow::dispose
) {
}
}
}
(not sure if it will work on all platforms).
Another approach - is to implement a window with your own decorations (undecorated = true)B bis
06/15/2021, 3:05 PMStefan Oltmann
08/31/2021, 2:39 PMjim
08/31/2021, 2:42 PMStefan Oltmann
08/31/2021, 2:43 PMjim
08/31/2021, 2:51 PM