5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-01 22:42:37 +08:00

Updated comments

This commit is contained in:
Lea Anthony 2019-01-14 22:46:45 +11:00
parent 561198b81b
commit 539be2ce84
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
6 changed files with 15 additions and 18 deletions

View File

@ -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

View File

@ -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

View File

@ -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()
}

View File

@ -1,5 +1,6 @@
package wails
// RuntimeEvents exposes the events interface
type RuntimeEvents struct {
eventManager *eventManager
}

View File

@ -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)
}

View File

@ -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()
}