Nikolay Igotti
3 years ago
9 changed files with 2968 additions and 3 deletions
@ -0,0 +1,4 @@
|
||||
package org.jetbrains.compose.kapp.demo |
||||
|
||||
// TODO: cannot have several entry points at the moment. |
||||
// fun main() = multiFrameApp() |
@ -0,0 +1,3 @@
|
||||
import org.jetbrains.compose.kapp.demo.simpleDemoApp |
||||
|
||||
fun main() = simpleDemoApp() |
@ -0,0 +1,3 @@
|
||||
package org.jetbrains.compose.kapp.demo |
||||
|
||||
fun main() = simpleDemoApp() |
@ -0,0 +1,40 @@
|
||||
package org.jetbrains.compose.kapp |
||||
|
||||
import androidx.compose.runtime.* |
||||
import androidx.compose.runtime.getValue |
||||
import androidx.compose.runtime.remember |
||||
import androidx.compose.ui.window.* |
||||
import org.jetbrains.skiko.wasm.onWasmReady |
||||
|
||||
@Composable |
||||
actual fun KAppScope.Frame(content: @Composable () -> Unit) { |
||||
content() |
||||
} |
||||
|
||||
|
||||
internal class AppAppScope : KAppScope { |
||||
|
||||
} |
||||
|
||||
internal actual fun kappImpl(name: String, title: String, content: @Composable KAppScope.() -> Unit) { |
||||
// TODO: make it multiframe. |
||||
val scope = AppAppScope() |
||||
scope.apply { |
||||
onWasmReady { |
||||
Window(title) { |
||||
content() |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
internal actual fun simpleKappImpl(name: String, content: @Composable () -> Unit) { |
||||
val appScope = AppAppScope() |
||||
appScope.apply { |
||||
onWasmReady { |
||||
Window(name) { |
||||
content() |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue