# README
webkitgtk

Pure Go WebKitGTK binding for Linux and FreeBSD.
This is pre release software so expect bugs and potentially API breaking changes but each release will be tagged to avoid breaking people's code.
Installation
# go 1.21.5+
go get github.com/malivvan/webkitgtk@latest
Example
The following example shows how to create a simple GTK window with a button that closes the application when clicked.
package main
import ui "github.com/malivvan/webkitgtk"
type API struct {
app *ui.App
}
func (a *API) Quit() error {
a.app.Quit()
return nil
}
func main() {
app := ui.New(ui.AppOptions{
Name: "example",
})
app.Open(ui.WindowOptions{
Title: "example",
HTML: `<button onclick="app.quit()">quit</button>`,
Define: map[string]interface{}{
"app": &API{app: app},
},
})
if err := app.Run(); err != nil {
panic(err)
}
}
Running / Building
Running / building defaults to debug mode outputting logs to stderr. To build in release mode use the release
build tag.
go build -tags release -ldflags "-s -w" -trimpath
The resulting release binary will be about ~6MB in size and cam be compressed further with UPX to about ~2.5MB.
Examples
- echo - call go functions from javascript
- dialog - application spawning different types of dialog windows
- handle - handle requests on the app:// uri scheme to serve embedded files
- notify - application sending different types of notifications
- systray - example application showing how to use the systray
Dependencies
Either
webkit2gtk-4.1
(stable) or
webkitgtk-6.0
(unstable)
is required at runtime. If both are installed the stable version will be used.
Debian / Ubuntu | apt install libwebkit2gtk-4.1 | apt install libwebkitgtk-6.0 |
RHEL / Fedora | dnf install webkitgtk4 | dnf install webkitgtk3 |
Arch | pacman -S webkit2gtk-4.1 | pacman -S webkitgtk-6.0 |
Alpine | apk add webkit2gtk | apk add webkit2gtk-6.0 |
Gentoo | emerge -av net-libs/webkit-gtk | |
FreeBSD | pkg install webkit2-gtk3 | pkg install webkit2-gtk4 |
License
This project is licensed under the MIT License.
# Packages
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gdk/gdkwindow.h#L121.
No description provided by the author
https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gdk/gdkevents.h#L512.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkmessagedialog.h#L87.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkdialog.h#L36.
actions in header bar instead of action area.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author