Found a way (after googling a bit more), I guess s...
# compose-desktop
l
Found a way (after googling a bit more), I guess since it's not officially mentioned it's probably beta/buggy: • https://slack-chats.kotlinlang.org/t/16597615/hello-does-compose-ui-compile-to-macos-i-d-like-to-integrate#ad4b3b9a-5831-4e69-8475-d15d715c441ahttps://github.com/JetBrains/compose-multiplatform/blob/d7a82a473261ac5397a2a3b39c[…]/examples/graphics-2d/shared/src/macosMain/kotlin/main.macos.kt For my use case (prototyping without needing to hookup a phone for bluetooth le access) it's good enough. Basically instead of appleMain you can use macosMain. In the
build.gradle.kts
you add:
Copy code
listOf(
    macosX64(),
    macosArm64()
).forEach { macosTarget ->
    macosTarget.binaries {
        executable {
            entryPoint = "main"
        }
    }
}
Then in your
main.macos.kt
inside the
macosMain/kotlin
folder you can add:
Copy code
import androidx.compose.ui.window.Window
import platform.AppKit.NSApp
import platform.AppKit.NSApplication

fun main() {
    NSApplication.sharedApplication()
    Window("My compose dialog") {
        // Compose code here
    }
    NSApp?.run()
}