You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import androidx.compose.desktop.DesktopMaterialTheme
|
|
|
|
import androidx.compose.desktop.ui.tooling.preview.Preview
|
|
|
|
import androidx.compose.material.Text
|
|
|
|
import androidx.compose.material.Button
|
|
|
|
import androidx.compose.material.MaterialTheme
|
|
|
|
import androidx.compose.runtime.*
|
|
|
|
import androidx.compose.ui.window.Window
|
|
|
|
import androidx.compose.ui.window.application
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Preview
|
|
|
|
fun Screen() {
|
|
|
|
var text by remember { mutableStateOf("Hello, World!") }
|
|
|
|
|
|
|
|
DesktopMaterialTheme {
|
|
|
|
Button(onClick = {
|
|
|
|
text = "Hello, Desktop!"
|
|
|
|
}) {
|
|
|
|
Text(text)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fun main() = application {
|
|
|
|
Window(onCloseRequest = ::exitApplication) {
|
|
|
|
Screen()
|
|
|
|
}
|
|
|
|
}
|