MatthiasMeger
04/17/2023, 12:03 PMMatthiasMeger
04/17/2023, 12:04 PM@OptIn(ExperimentalMaterialApi::class)
fun main() = application {
Window(onCloseRequest = ::exitApplication) {
var text by mutableStateOf("Nothing clicked")
MenuBar {
Menu("Test") {
Item("Menu item") { text = "Menu item clicked" }
}
}
Button(onClick = { text = "Button clicked " }) {
Text(text)
}
var showDialog by remember { mutableStateOf(true) }
if (showDialog) {
AlertDialog(
onDismissRequest = { },
text = { Text("Alert dialog") },
confirmButton = {
TextButton(onClick = { showDialog = false }) {
Text("ok")
}
}
)
}
}
}
Alexander Maryanovsky
04/17/2023, 1:42 PMMatthiasMeger
04/17/2023, 1:50 PMAlexander Maryanovsky
04/17/2023, 1:50 PM