mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 21:29:09 +08:00
basic implement
This commit is contained in:
parent
b7a4aba5f3
commit
fda3323386
@ -206,6 +206,9 @@ func (f *Frontend) WindowSetRGBA(col *options.RGBA) {
|
||||
}
|
||||
|
||||
func (f *Frontend) Quit() {
|
||||
if f.frontendOptions.OnBeforeClose != nil && f.frontendOptions.OnBeforeClose(f.ctx) {
|
||||
return
|
||||
}
|
||||
f.mainWindow.Quit()
|
||||
}
|
||||
|
||||
|
@ -208,6 +208,9 @@ func (f *Frontend) WindowSetRGBA(col *options.RGBA) {
|
||||
}
|
||||
|
||||
func (f *Frontend) Quit() {
|
||||
if f.frontendOptions.OnBeforeClose != nil && f.frontendOptions.OnBeforeClose(f.ctx) {
|
||||
return
|
||||
}
|
||||
f.mainWindow.Quit()
|
||||
}
|
||||
|
||||
|
@ -261,6 +261,9 @@ func (f *Frontend) WindowSetRGBA(col *options.RGBA) {
|
||||
}
|
||||
|
||||
func (f *Frontend) Quit() {
|
||||
if f.frontendOptions.OnBeforeClose != nil && f.frontendOptions.OnBeforeClose(f.ctx) {
|
||||
return
|
||||
}
|
||||
// Exit must be called on the Main-Thread. It calls PostQuitMessage which sends the WM_QUIT message to the thread's
|
||||
// message queue and our message queue runs on the Main-Thread.
|
||||
f.mainWindow.Invoke(winc.Exit)
|
||||
|
@ -45,9 +45,10 @@ type App struct {
|
||||
Menu *menu.Menu
|
||||
Logger logger.Logger `json:"-"`
|
||||
LogLevel logger.LogLevel
|
||||
OnStartup func(ctx context.Context) `json:"-"`
|
||||
OnDomReady func(ctx context.Context) `json:"-"`
|
||||
OnShutdown func(ctx context.Context) `json:"-"`
|
||||
OnStartup func(ctx context.Context) `json:"-"`
|
||||
OnDomReady func(ctx context.Context) `json:"-"`
|
||||
OnShutdown func(ctx context.Context) `json:"-"`
|
||||
OnBeforeClose func(ctx context.Context) (prevent bool) `json:"-"`
|
||||
Bind []interface{}
|
||||
WindowStartState WindowStartState
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user