diff --git a/v3/internal/templates/_common/main.go.tmpl b/v3/internal/templates/_common/main.go.tmpl index edeb549c5..1d710c243 100644 --- a/v3/internal/templates/_common/main.go.tmpl +++ b/v3/internal/templates/_common/main.go.tmpl @@ -27,17 +27,27 @@ func main() { }) // Create window app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ - Title: "Plain Bundle", - CSS: `body { background-color: rgba(255, 255, 255, 0); } .main { color: white; margin: 20%; }`, + Title: "Window 1", Mac: application.MacWindow{ InvisibleTitleBarHeight: 50, Backdrop: application.MacBackdropTranslucent, TitleBar: application.MacTitleBarHiddenInset, }, - + BackgroundColour: application.NewRGB(36, 36, 36), URL: "/", }) + go func() { + for { + now := time.Now().Format(time.RFC1123) + app.Events.Emit(&application.WailsEvent{ + Name: "time", + Data: now, + }) + time.Sleep(time.Second) + } + }() + err := app.Run() if err != nil { diff --git a/v3/internal/templates/vanilla/frontend/index.html b/v3/internal/templates/vanilla/frontend/index.html index 142c24f8c..17eb8b3c3 100644 --- a/v3/internal/templates/vanilla/frontend/index.html +++ b/v3/internal/templates/vanilla/frontend/index.html @@ -8,23 +8,31 @@