mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 04:59:38 +08:00
Updated comments
This commit is contained in:
parent
561198b81b
commit
539be2ce84
17
.1.gitignore
17
.1.gitignore
@ -1,17 +0,0 @@
|
||||
lib/project/templates/vue
|
||||
lib/project/templates/blank
|
||||
tools
|
||||
test
|
||||
.vscode/
|
||||
tmp
|
||||
examples/**/example*
|
||||
!examples/**/*.*
|
||||
node_modules
|
||||
cmd.old
|
||||
lib.old
|
||||
cmd/wails/wails
|
||||
.DS_Store
|
||||
rewrite
|
||||
.rewrite
|
||||
examples/WIP/*
|
||||
docs
|
@ -1,5 +1,6 @@
|
||||
package wails
|
||||
|
||||
// Runtime is the Wails Runtime Interface, given to a user who has defined the WailsInit method
|
||||
type Runtime struct {
|
||||
Events *RuntimeEvents
|
||||
Log *RuntimeLog
|
||||
|
@ -1,23 +1,28 @@
|
||||
package wails
|
||||
|
||||
// RuntimeDialog exposes an interface to native dialogs
|
||||
type RuntimeDialog struct {
|
||||
renderer Renderer
|
||||
}
|
||||
|
||||
// newRuntimeDialog creates a new RuntimeDialog struct
|
||||
func newRuntimeDialog(renderer Renderer) *RuntimeDialog {
|
||||
return &RuntimeDialog{
|
||||
renderer: renderer,
|
||||
}
|
||||
}
|
||||
|
||||
// SelectFile prompts the user to select a file
|
||||
func (r *RuntimeDialog) SelectFile() string {
|
||||
return r.renderer.SelectFile()
|
||||
}
|
||||
|
||||
// SelectDirectory prompts the user to select a directory
|
||||
func (r *RuntimeDialog) SelectDirectory() string {
|
||||
return r.renderer.SelectDirectory()
|
||||
}
|
||||
|
||||
// SelectSaveFile prompts the user to select a file for saving
|
||||
func (r *RuntimeDialog) SelectSaveFile() string {
|
||||
return r.renderer.SelectSaveFile()
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package wails
|
||||
|
||||
// RuntimeEvents exposes the events interface
|
||||
type RuntimeEvents struct {
|
||||
eventManager *eventManager
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package wails
|
||||
|
||||
// RuntimeLog exposes the logging interface to the runtime
|
||||
type RuntimeLog struct {
|
||||
}
|
||||
|
||||
@ -7,6 +8,7 @@ func newRuntimeLog() *RuntimeLog {
|
||||
return &RuntimeLog{}
|
||||
}
|
||||
|
||||
// New creates a new logger
|
||||
func (r *RuntimeLog) New(prefix string) *CustomLogger {
|
||||
return newCustomLogger(prefix)
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package wails
|
||||
|
||||
// RuntimeWindow exposes an interface for manipulating the window
|
||||
type RuntimeWindow struct {
|
||||
renderer Renderer
|
||||
}
|
||||
@ -10,23 +11,27 @@ func newRuntimeWindow(renderer Renderer) *RuntimeWindow {
|
||||
}
|
||||
}
|
||||
|
||||
// SetColour sets the the window colour
|
||||
func (r *RuntimeWindow) SetColour(colour string) error {
|
||||
return r.renderer.SetColour(colour)
|
||||
}
|
||||
|
||||
// Fullscreen makes the window fullscreen
|
||||
func (r *RuntimeWindow) Fullscreen() {
|
||||
r.renderer.Fullscreen()
|
||||
}
|
||||
|
||||
// UnFullscreen attempts to restore the window to the size/position before fullscreen
|
||||
func (r *RuntimeWindow) UnFullscreen() {
|
||||
r.renderer.UnFullscreen()
|
||||
}
|
||||
|
||||
// SetTitle sets the the window title
|
||||
func (r *RuntimeWindow) SetTitle(title string) {
|
||||
r.renderer.SetTitle(title)
|
||||
}
|
||||
|
||||
// Close shuts down the window and therefore the app
|
||||
func (r *RuntimeWindow) Close() {
|
||||
// TODO: Add shutdown mechanism
|
||||
r.renderer.Close()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user