webview_go/README.md

52 lines
1.5 KiB
Markdown
Raw Normal View History

2024-04-25 16:42:15 +01:00
# webview_go-4.1
2020-06-12 14:35:27 +01:00
2024-05-02 08:48:33 +01:00
[![GoDoc](https://godoc.org/centrifuge.hectabit.org/HectaBit/webview_go?status.svg)](https://godoc.org/centrifuge.hectabit.org/HectaBit/webview_go)
[![Go Report Card](https://goreportcard.com/badge/centrifuge.hectabit.org/HectaBit/webview_go)](https://goreportcard.com/report/centrifuge.hectabit.org/HectaBit/webview_go)
2024-04-25 16:42:15 +01:00
Go language binding for the [webview library][webview], for webkitgtk-4.1.
This is entirely backwards compatible with webview_go 4.0, and needs only a dependency replacement.
> [!NOTE]
> Versions <= 0.1.1 are available in the [old repository][webview].
### Getting Started
See [Go package documentation][go-docs] for the Go API documentation, or simply read the source code.
Start with creating a new directory structure for your project.
```sh
mkdir my-project && cd my-project
```
Create a new Go module.
```sh
go mod init example.com/app
```
Save one of the example programs into your project directory.
```sh
2024-05-02 08:48:33 +01:00
curl -sSLo main.go "https://centrifuge.hectabit.org/HectaBit/webview_go/raw/branch/master/examples/basic/main.go"
```
Install dependencies.
```sh
2024-05-02 08:48:33 +01:00
go get centrifuge.hectabit.org/HectaBit/webview_go
```
Build the example. On Windows, add `-ldflags="-H windowsgui"` to the command line.
```sh
go build
```
### Notes
Calling `Eval()` or `Dispatch()` before `Run()` does not work because the webview instance has only been configured and not yet started.
2024-05-02 08:48:33 +01:00
[go-docs]: https://pkg.go.dev/centrifuge.hectabit.org/HectaBit/webview_go
[webview]: https://github.com/webview/webview