goui

package module
v0.0.0-...-dd19e1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2014 License: GPL-2.0 Imports: 11 Imported by: 0

README

goui

HTML5/JS browser wrapper for golang gui apps with minimal dependencies. See https://github.com/thingalon/goui-example for an example app.

Note that this does not offer buttons, widgets, etc. You can use any standard JS/HTML5 library to implement those for you.

Documentation

Index

Constants

View Source
const (
	WindowTitled      = 0
	WindowBorderless  = 1 << iota
	WindowClosable    = 1 << iota
	WindowResizable   = 1 << iota
	WindowMinimizable = 1 << iota
	WindowModal       = 1 << iota
)

Variables

This section is empty.

Functions

func GetScreenSize

func GetScreenSize() (width int, height int)

func Run

func Run(readyCallback func())

func SetAssetPath

func SetAssetPath(a string)

func SetBindataSource

func SetBindataSource(assetFunc func(name string) ([]byte, error))

func SetMessageHandler

func SetMessageHandler(messageName string, handler func(*Window, *Message) Data)

func Stop

func Stop()

Types

type Data

type Data map[string]interface{}

type Message

type Message struct {
	Type   string
	Params Data
}

type Window

type Window struct {
	// contains filtered or unexported fields
}

func GetWindow

func GetWindow(id int) *Window

func OpenWindow

func OpenWindow(options WindowOptions) *Window

func (*Window) Close

func (window *Window) Close()

func (*Window) Send

func (window *Window) Send(message Message)

func (*Window) SetCloseHandler

func (window *Window) SetCloseHandler(handler func(window *Window))

func (*Window) SetPosition

func (window *Window) SetPosition(left int, top int)

func (*Window) SetSize

func (window *Window) SetSize(width int, height int)

func (*Window) SetTitle

func (window *Window) SetTitle(title string)

type WindowOptions

type WindowOptions struct {
	//	Required options
	Template   string
	StyleFlags int

	//	Specify a window title, rather than relying on the HTML <title> tag
	Title string

	//	Specify window size as a fixed pixel size or percent of screen size
	PixelWidth    int
	PixelHeight   int
	PercentWidth  float64
	PercentHeight float64

	//	Specify positioning rules; either centered, by pixel, or by percent.
	Centered    bool
	PixelLeft   int
	PixelTop    int
	PercentLeft float64
	PercentTop  float64

	RememberGeometry bool
	OpenInBrowser    bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL