Create hello-platform for Windows #10

Open
kornerr wants to merge 46 commits from hrbmac into master
pull from: hrbmac
6 changed files with 38 additions and 5 deletions
Showing only changes of commit 777f340fb8 - Show all commits

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import SwiftCrossUI
final class HPVM: ObservableObject {
@Published var countText = ""
static private(set) weak var shared: HPVM?
init() {
Self.shared = self
}
}
+22
View File
@@ -0,0 +1,22 @@
import SwiftCrossUI
struct HPView: View {
@State var vm: HPVM
init(_ vm: HPVM) {
self.vm = vm
}
var body: some View {
VStack(spacing: 16) {
Text("Hello, platform!")
.font(.largeTitle)
Text(vm.countText)
.font(.title3.monospaced())
Button("Increment") {
hpSet(F.didClickIncrement, true)
}
}
.padding(40)
}
}
+2 -2
View File
@@ -227,8 +227,8 @@ by this packaging step.
## Windows (WinUI) ## Windows (WinUI)
`ver-windows/` mirrors the Linux SwiftCrossUI target with `WinUIBackend`. `ver-windows/` mirrors the Linux SwiftCrossUI target with `WinUIBackend`.
It shares the counter component, model, view, and generated Swift dialect via It shares the counter component and generated Swift dialect via
relative symlinks. Check out the repository with Git symlinks enabled on Windows relative symlinks. Its SwiftCrossUI model and view live in `components/hp/windows`. Check out the repository with Git symlinks enabled on Windows
(Developer Mode or appropriate symlink permissions are needed). (Developer Mode or appropriate symlink permissions are needed).
With the Windows Swift toolchain, Windows SDK, and the Windows App SDK runtime With the Windows Swift toolchain, Windows SDK, and the Windows App SDK runtime
@@ -1 +1 @@
../../../../../components/hp/linux/hp.swift ../../../../../components/hp/hp.swift
@@ -1 +1 @@
../../../../../components/hp/linux/hpVM.swift ../../../../../components/hp/windows/hpVM.swift
@@ -1 +1 @@
../../../../../../components/hp/linux/view/HPView.swift ../../../../../../components/hp/windows/view/HPView.swift