5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 07:29:56 +08:00
wails/v3/pkg/application/context_window_event.go
2023-10-21 11:21:10 +11:00

35 lines
617 B
Go

package application
var blankWindowEventContext = &WindowEventContext{}
const (
droppedFiles = "droppedFiles"
)
type WindowEventContext struct {
// contains filtered or unexported fields
data map[string]any
}
func (c WindowEventContext) DroppedFiles() []string {
files, ok := c.data[droppedFiles]
if !ok {
return nil
}
result, ok := files.([]string)
if !ok {
return nil
}
return result
}
func (c WindowEventContext) setDroppedFiles(files []string) {
c.data[droppedFiles] = files
}
func newWindowEventContext() *WindowEventContext {
return &WindowEventContext{
data: make(map[string]any),
}
}