From fc7952ff3b03b4b8d99009670b765254bb0d2797 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 5 Jun 2023 20:34:52 +1000 Subject: [PATCH] [v3 windows] Update examples. Add example table to STATUS.md --- v3/STATUS.md | 22 ++++++++++++++++++++++ v3/examples/contextmenus/main.go | 1 + v3/examples/plain/main.go | 7 +++++++ 3 files changed, 30 insertions(+) diff --git a/v3/STATUS.md b/v3/STATUS.md index 92c83f0b..45437ffa 100644 --- a/v3/STATUS.md +++ b/v3/STATUS.md @@ -313,3 +313,25 @@ Built-in plugin support: | WindowMask | nil | Makes the window the contents of the bitmap | ## Linux Specific + +## Examples + +| Example | Windows | Linux | Mac | +|--------------|---------|-------|-----| +| binding | | | | +| build | | | | +| clipboard | | | | +| contextmenus | | | | +| dialogs | | | | +| drag-n-drop | | | | +| events | | | | +| frameless | | | | +| kitchensink | | | | +| menu | | | | +| plain | | | | +| plugins | | | | +| screen | | | | +| systray | | | | +| window | | | | +| windowjs | | | | +| wml | | | | diff --git a/v3/examples/contextmenus/main.go b/v3/examples/contextmenus/main.go index ad428e09..1b13001f 100644 --- a/v3/examples/contextmenus/main.go +++ b/v3/examples/contextmenus/main.go @@ -46,6 +46,7 @@ func main() { contextMenu := app.NewMenu() contextMenu.Add("Click Me").OnClick(func(data *application.Context) { fmt.Printf("Context menu data: %+v\n", data.ContextMenuData()) + app.Quit() }) globalContextMenu := app.NewMenu() diff --git a/v3/examples/plain/main.go b/v3/examples/plain/main.go index 83cfdea1..3767400b 100644 --- a/v3/examples/plain/main.go +++ b/v3/examples/plain/main.go @@ -35,6 +35,13 @@ func main() { URL: "/", }) + app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ + Title: "HTML TEST", + HTML: "

AWESOME!

", + CSS: `body { background-color: rgba(255, 0, 0, 255); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; user-select: none; -ms-user-select: none; -webkit-user-select: none; } .main { color: white; margin: 20%; }`, + JS: `window.iamhere = function() { console.log("Hello World!"); }`, + }) + app.Events.On("clicked", func(_ *application.WailsEvent) { println("clicked") })