Skip to content

Commit 0ce98f2

Browse files
committed
initial experiment of using webview
1 parent 8955c3f commit 0ce98f2

File tree

5 files changed

+57
-0
lines changed

5 files changed

+57
-0
lines changed

.github/workflows/build.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build
2+
on:
3+
pull_request:
4+
push:
5+
branches: [ main ]
6+
jobs:
7+
build:
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [windows-latest, ubuntu-latest, macos-latest]
12+
# include:
13+
# - os: [self-hosted, ARM64]
14+
# - os: [self-hosted, ARMHF]
15+
name: Make
16+
runs-on: ${{ matrix.os }}
17+
continue-on-error: ${{ contains(matrix.os, 'self-hosted') }}
18+
steps:
19+
- name: Set up Go.
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: ^1.17
23+
id: go
24+
- name: Check out code into the Go module directory
25+
uses: actions/checkout@v2
26+
with:
27+
fetch-depth: 0
28+
- name: Build
29+
run: go build .

app/app.go

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package app
2+
3+
import "github.com/webview/webview"
4+
5+
func Run() {
6+
debug := true
7+
w := webview.New(debug)
8+
defer w.Destroy()
9+
10+
w.SetTitle("Minimal webview example")
11+
w.SetSize(800, 600, webview.HintNone)
12+
w.Navigate("https://en.m.wikipedia.org/wiki/Main_Page")
13+
w.Run()
14+
}

go.mod

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/kopia/ui-shell
2+
3+
go 1.17
4+
5+
require github.com/webview/webview v0.0.0-20210330151455-f540d88dde4e // indirect

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/webview/webview v0.0.0-20210330151455-f540d88dde4e h1:z780M7mCrdt6KiICeW9SGirvQjxDlrVU+n99FO93nbI=
2+
github.com/webview/webview v0.0.0-20210330151455-f540d88dde4e/go.mod h1:rpXAuuHgyEJb6kXcXldlkOjU6y4x+YcASKKXJNUhh0Y=

main.go

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package main
2+
3+
import "github.com/kopia/ui-shell/app"
4+
5+
func main() {
6+
app.Run()
7+
}

0 commit comments

Comments
 (0)