ultralight

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

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

Go to latest
Published: May 17, 2020 License: MIT Imports: 3 Imported by: 0

README

Go Report Card GoDoc Build Status codecov

Go-Ultralight

Please read the installation instructions below

Go-Ultralight provides unofficial bindings for the Ultralight UI library, endeavouring to match the original API as closely as possible. This project borrows heavily from the wonderful work of Raff found here.

What is Ultralight?

Ultralight (https://ultralig.ht) is a HTML UI library, written in C++, that provides a performant and lightweight alternative to Electron, with JavaScript support.

Licensing

While this wrapper is open-source, the Ultralight project is not. Use of the binaries downloaded either manually or using the tool must be in accordance with their licensing terms. Usage is free for non-commercial applications, with the full pricing hierarchy available on the website linked below:

https://ultralig.ht/#pricing

Installation

Prerequisites

You must have a working CGo installation and have the GOPATH set.

All Methods

  1. Run:

    go get -d github.com/maneac/go-ultralight/...

    to download the project and the installation and setup utility. Then, install the optional utility:

    go install github.com/maneac/go-ultralight/go-ultralight

Automated

  1. Navigate to your project's directory and execute:

    go-ultralight [OPTIONS]

    to automatically download the Ultralight SDK and copy the necessary binaries for running your application. For more information on the available options, please read the utility's help (go-ultralight --help).
  2. That's it! Now you're ready to Go-Ultralight!

Manual

  1. Download the Ultralight SDK for your system from https://ultralig.ht.

  2. Locate your installation of Go-Ultralight (typically in $GOPATH/src/github.com/maneac/go-ultralight or $GOPATH/pkg/mod/github.com/maneac/go-ultralight), and extract the Ultralight SDK into an 'SDK' folder inside. Example structure:

    github.com
      |-maneac
        |-go-ultralight
          |-go-ultralight
          |-examples
          |-SDK
       	    |-bin
                |-AppCore.dll
                |-AppCore.dylib
       	        |-libAppCore.so
                |-...
            |-deps
            |-include
            ...
    
  3. Copy the binary files (*.dylib, *.dll, *.so) for your target system type from the 'SDK/bin' folder into your project directory. Example project directory:

    exampleProject
      |-AppCore.dll
      |-main.go
      |-Ultralight.dll
      |-UltralightCore.dll
      |-WebCore.dll
    

Use

If you are a non-Windows user, run the following to enable detection of the binaries:
export CGO_LDFLAGS_ALLOW=-Wl,-rpath.*

After installation, use the setup utility go-ultralight , or follow step 4 of the manual installation to copy the necessary binary files to your project directory. These files are required to run the compiled program.

Please build your project with go build instead of using go run, as run has been known to cause issues with the Browser example.

For examples, please see the 'examples' directory, which contains Go implementations of the sample projects provided with the Ultralight SDK.

To Do

  • Add support for inspector view
  • Write tests

Last updated: 17/05/2020

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App wraps the underlying App struct

func CreateApp

func CreateApp(settings *Settings, conf *Config) *App

CreateApp creates an App instance (create only one per application lifetime)

func (*App) Destroy

func (a *App) Destroy()

Destroy deletes the App instance

func (*App) GetMainMonitor

func (a *App) GetMainMonitor() *Monitor

GetMainMonitor returns the main Monitor instance

func (*App) GetRenderer

func (a *App) GetRenderer() *Renderer

GetRenderer returns the underlying Renderer instance

func (*App) GetWindow

func (a *App) GetWindow() *Window

GetWindow returns the main Window

func (*App) IsRunning

func (a *App) IsRunning() bool

IsRunning returns whether the App is running

func (*App) Quit

func (a *App) Quit()

Quit exits the application

func (*App) Run

func (a *App) Run()

Run executes the main loop. Ensure App.SetWindow() has been called prior to calling

func (*App) SetUpdateCallback

func (a *App) SetUpdateCallback(callFunc func())

SetUpdateCallback executes the specified function whenever the App updates

func (*App) SetWindow

func (a *App) SetWindow(win *Window)

SetWindow sets the main window. This must be called before App.Run()

type Bitmap

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

Bitmap wraps the underlying struct

func CreateBitmap

func CreateBitmap(width, height uint, format BitmapFormat) *Bitmap

CreateBitmap will produce a bitmap with the specified parameters

func CreateEmptyBitmap

func CreateEmptyBitmap() *Bitmap

CreateEmptyBitmap will create an empty bitmap

func (*Bitmap) BytesPerPixel

func (bit *Bitmap) BytesPerPixel() uint

BytesPerPixel returns the bytes per pixel of the bitmap

func (*Bitmap) CreateCopy

func (bit *Bitmap) CreateCopy() *Bitmap

CreateCopy creates a copy of the bitmap

func (*Bitmap) Destroy

func (bit *Bitmap) Destroy()

Destroy destroys a bitmap

func (*Bitmap) Erase

func (bit *Bitmap) Erase()

Erase resets the bitmap pixels to 0

func (*Bitmap) Format

func (bit *Bitmap) Format() BitmapFormat

Format returns the format of the bitmap

func (*Bitmap) Height

func (bit *Bitmap) Height() uint

Height returns the height of the bitmap

func (*Bitmap) IsEmpty

func (bit *Bitmap) IsEmpty() bool

IsEmpty returns whether the bitmap is empty or not

func (*Bitmap) RowBytes

func (bit *Bitmap) RowBytes() uint

RowBytes returns the bytes per row of the bitmap

func (*Bitmap) Width

func (bit *Bitmap) Width() uint

Width returns the width of the bitmap

func (*Bitmap) WritePNG

func (bit *Bitmap) WritePNG(path string) bool

WritePNG writes the Bitmap to the specified path as a PNG

type BitmapFormat

type BitmapFormat int

BitmapFormat enumerates the possible formats for a bitmap

const (
	A8 BitmapFormat = iota
	RGBA8
)

The bitmap formats

type Config

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

Config wraps the C config stuct

func CreateConfig

func CreateConfig() *Config

CreateConfig creates a Config instance

func (*Config) AnimationTimerDelay

func (conf *Config) AnimationTimerDelay(delay float64)

AnimationTimerDelay sets the amount of time to wait before repainting when a CSS animation is active (Default = 1/60)

func (*Config) Destroy

func (conf *Config) Destroy()

Destroy deletes the Config instance

func (*Config) DeviceScaleHint

func (conf *Config) DeviceScaleHint(value float64)

DeviceScaleHint sets the amount that the application DPI has been scaled, which is used for scaling device coordinates to pixels and oversampling raster shapes (Default = 1.0)

func (*Config) EnableBGRA

func (conf *Config) EnableBGRA(enabled bool)

EnableBGRA sets wheter to use BGRA byte order (instead of RGBA) for offscreen rendering of View bitmaps (Default = false)

func (*Config) EnableImages

func (conf *Config) EnableImages(enabled bool)

EnableImages sets whether images should be enabled (Default = true)

func (*Config) EnableJavaScript

func (conf *Config) EnableJavaScript(enabled bool)

EnableJavaScript sets whether JavaScript should be enabled (Default = true)

func (*Config) FontFamilyFixed

func (conf *Config) FontFamilyFixed(fontName string)

FontFamilyFixed sets the default font-family to use for fixed fonts, e.g. <pre> and <code> (Default = "Courier New")

func (*Config) FontFamilySansSerif

func (conf *Config) FontFamilySansSerif(fontName string)

FontFamilySansSerif sets the default font-family to use for sans-serif fonts (Default = "Arial")

func (*Config) FontFamilySerif

func (conf *Config) FontFamilySerif(fontName string)

FontFamilySerif sets the default font-family to use for serif fonts (Default = "Times New Roman")

func (*Config) FontFamilyStandard

func (conf *Config) FontFamilyStandard(fontName string)

FontFamilyStandard sets the default font-family to use (Default = "Times New Roman")

func (*Config) ForceRepaint

func (conf *Config) ForceRepaint(enabled bool)

ForceRepaint sets whether the views should be continuously repainted or not. Mainly used for diagnosis

func (*Config) MemoryCacheSize

func (conf *Config) MemoryCacheSize(size uint)

MemoryCacheSize sets the size of the cache for assets in bytes (Default = 64MB)

func (*Config) PageCacheSize

func (conf *Config) PageCacheSize(size uint)

PageCacheSize sets the number of pages to keep cached (Default = 0)

func (*Config) UserAgent

func (conf *Config) UserAgent(agent string)

UserAgent sets the user agent string

func (*Config) UserStylesheet

func (conf *Config) UserStylesheet(css string)

UserStylesheet sets the user stylesheet (CSS) (Default = Empty)

type Cursor

type Cursor int

Cursor enumerates the different types of cursor to show

const (
	Pointer Cursor = iota
	Cross
	Hand
	IBeam
	Wait
	Help
	EastResize
	NorthResize
	NorthEastResize
	NorthWestResize
	SouthResize
	SouthEastResize
	SouthWestResize
	WestResize
	NorthSouthResize
	EastWestResize
	NorthEastSouthWestResize
	NorthWestSouthEastResize
	ColumnResize
	RowResize
	MiddlePanning
	EastPanning
	NorthPanning
	NorthEastPanning
	NorthWestPanning
	SouthPanning
	SouthEastPanning
	SouthWestPanning
	WestPanning
	Move
	VerticalText
	Cell
	ContextMenu
	Alias
	Progress
	NoDrop
	Copy
	CursorNone
	NotAllowed
	ZoomIn
	ZoomOut
	Grab
	Grabbing
	Custom
)

The cursor types

type JSBindFunc

type JSBindFunc func(view *View, params []string) *JSValue

JSBindFunc defines the structure of JavaScript callback functions, where 'params' is an array of the parameters passed to the JavaScript function

type JSContext

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

JSContext wraps the underlying struct

type JSValue

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

JSValue wraps the underlying struct

type KeyEvent

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

KeyEvent wraps the underlying struct

func CreateKeyEvent

func CreateKeyEvent(eventType KeyEventType,
	modifiers uint, virtKeyCode, nativeKeyCode int,
	text, rawText string, isKeypad, isAutoRepeat, isSystemKey bool) *KeyEvent

CreateKeyEvent creates a new key event

func (*KeyEvent) Destroy

func (ke *KeyEvent) Destroy()

Destroy destroys the key event

type KeyEventType

type KeyEventType int

KeyEventType enumerates the possible key events

const (
	KeyDown KeyEventType = iota
	KeyUp
	RawKeyDown
	Char
)

KeyEventTypes

type MessageLevel

type MessageLevel int

MessageLevel enumerates the severity levels of a message

const (
	Log MessageLevel = iota + 1
	Warning
	Error
	Debug
	Info
)

The severity levels

type MessageSource

type MessageSource int

MessageSource enumerates the possible sources for a message

const (
	XML MessageSource = iota
	JS
	Network
	ConsoleAPI
	Storage
	AppCache
	Rendering
	CSS
	Security
	ContentBlocker
	Other
)

The message sources

type Monitor

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

Monitor wraps the underlying struct

func (*Monitor) GetHeight

func (mon *Monitor) GetHeight() uint

GetHeight returns the height of the monitor (in device coordinates)

func (*Monitor) GetScale

func (mon *Monitor) GetScale() float64

GetScale returns the DPI scale of the Monitor as a percentage

func (*Monitor) GetWidth

func (mon *Monitor) GetWidth() uint

GetWidth returns the width of the monitor (in device coordinates)

type MouseButton

type MouseButton int

MouseButton enumerates the possible mouse buttons

const (
	MouseButtonNone MouseButton = iota
	Left
	Middle
	Right
)

MouseButtons

type MouseEvent

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

MouseEvent wraps the underlying struct

func CreateMouseEvent

func CreateMouseEvent(eventType MouseEventType, x, y int, button MouseButton) *MouseEvent

CreateMouseEvent creates a new mouse event

func (*MouseEvent) Destroy

func (me *MouseEvent) Destroy()

Destroy destroys the mouse event

type MouseEventType

type MouseEventType int

MouseEventType enumerates the possible mouse events

const (
	MouseMoved MouseEventType = iota
	MouseDown
	MouseUp
)

MouseEventTypes

type Overlay

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

Overlay wraps the underlying struct

func CreateOverlay

func CreateOverlay(win *Window, width, height uint, x, y int) *Overlay

CreateOverlay creates a new Overlay instance with the specified width and height (in device coordinates) at the offset (x,y) from the top-left corner of the Window instance

func (*Overlay) Destroy

func (ol *Overlay) Destroy()

Destroy deletes the Overlay instance

func (*Overlay) Focus

func (ol *Overlay) Focus()

Focus grants the Overlay exclusive keyboard focus

func (*Overlay) GetHeight

func (ol *Overlay) GetHeight() uint

GetHeight returns the height of the Overlay (in device coordinates)

func (*Overlay) GetView

func (ol *Overlay) GetView() *View

GetView returns the underlying View instance

func (*Overlay) GetWidth

func (ol *Overlay) GetWidth() uint

GetWidth returns the width of the Overlay (in device coordinates)

func (*Overlay) GetX

func (ol *Overlay) GetX() int

GetX returns the horizontal offset of the Overlay relative to it's Window (in device coordinates)

func (*Overlay) GetY

func (ol *Overlay) GetY() int

GetY returns the vertical offset of the Overlay relative to it's Window (in device coordinates)

func (*Overlay) HasFocus

func (ol *Overlay) HasFocus() bool

HasFocus returns whether the Overlay has keyboard focus

func (*Overlay) Hide

func (ol *Overlay) Hide()

Hide stops the Overlay from being drawn

func (*Overlay) IsHidden

func (ol *Overlay) IsHidden() bool

IsHidden returns whether the Overlay is hidden or drawn

func (*Overlay) MoveTo

func (ol *Overlay) MoveTo(x, y int)

MoveTo moves the Overlay to the specified (x,y) position (in device coordinates)

func (*Overlay) Resize

func (ol *Overlay) Resize(width, height uint)

Resize sets the size of the Overlay and it's underlying View to the specified dimensions (in device coordinates)

func (*Overlay) Show

func (ol *Overlay) Show()

Show draws the Overlay instance

func (*Overlay) Unfocus

func (ol *Overlay) Unfocus()

Unfocus revokes exclusive keyboard focus from the Overlay

type Renderer

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

Renderer wraps the underlying struct

func CreateRenderer

func CreateRenderer(conf *Config) *Renderer

CreateRenderer creates a Renderer instance (create only one per application lifetime)

func (*Renderer) Destroy

func (rend *Renderer) Destroy()

Destroy deletes the Renderer instance

func (*Renderer) Render

func (rend *Renderer) Render()

Render renders all active views to their respective bitmaps

func (*Renderer) Update

func (rend *Renderer) Update()

Update dispatches internal Javascript and network callbacks and updates timers

type ScrollEvent

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

ScrollEvent wraps the underlying struct

func CreateScrollEvent

func CreateScrollEvent(eventType ScrollEventType, deltaX, deltaY int) *ScrollEvent

CreateScrollEvent creates a new scroll event

func (*ScrollEvent) Destroy

func (se *ScrollEvent) Destroy()

Destroy destroys the scroll event

type ScrollEventType

type ScrollEventType int

ScrollEventType enumerates the possible ways of scrolling

const (
	ScrollByPixel ScrollEventType = iota
	ScrollByPage
)

ScrollEventTypes

type Settings

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

Settings wraps the underlying struct

func CreateSettings

func CreateSettings() *Settings

CreateSettings creates settings with default values

func (*Settings) Destroy

func (s *Settings) Destroy()

Destroy deletes the settings

func (*Settings) SetFileSystemPath

func (s *Settings) SetFileSystemPath(path string)

SetFileSystemPath sets the root file path for all data used by the app

func (*Settings) SetLoadShadersFromFileSystem

func (s *Settings) SetLoadShadersFromFileSystem(enable bool)

SetLoadShadersFromFileSystem decides whether or not to load and compile shaders from the file system or load pre-compiled shaders from memory

type View

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

View wraps the underlying struct

func CreateView

func CreateView(rend *Renderer, width, height uint, isTransparent bool) *View

CreateView creates a View instance with the specified size (in device coordinates)

func (*View) BindJSCallback

func (view *View) BindJSCallback(name string, function JSBindFunc)

BindJSCallback executes the specified function when a JavaScript call to the 'name' function is made

Example
// Create the app instance
config := ultralight.CreateConfig()
renderer := ultralight.CreateRenderer(config)
view := ultralight.CreateView(renderer, 300, 300, false)

// Prints each name passed to the 'hello' JavaScript function to the console
view.BindJSCallback("hello", func(v *ultralight.View, parameters []string) *ultralight.JSValue {
	for i := range parameters {
		if parameters[i] == "" {
			fmt.Println("Hello mystery person!")
			continue
		}
		fmt.Printf("Hello %s!\n", parameters[i])
	}
	return nil
})

isReady := false

// Execute the JavaScript function when the page has finished loading
view.SetDOMReadyCallback(func() {
	view.EvaluateScript("hello('John', 'Anita', '', 'Derek')")
	isReady = true
})

// Give the View something to load to trigger the above function
view.LoadHTML("<html></html>")

// Update the View until the DOM is ready
for !isReady {
	renderer.Update()
}

// Will output:
// Hello John!
// Hello Anita!
// Hello mystery person!
// Hello Derek!
Output:

func (*View) CanGoBack

func (view *View) CanGoBack() bool

CanGoBack checks if backwards history navigation is available

func (*View) CanGoForward

func (view *View) CanGoForward() bool

CanGoForward checks if forward history navigation is available

func (*View) Destroy

func (view *View) Destroy()

Destroy deletes the View instance

func (*View) EvaluateScript

func (view *View) EvaluateScript(script string) string

EvaluateScript evaluates a raw string of JavaScript, and returns the result

func (*View) FireKeyEvent

func (view *View) FireKeyEvent(event *KeyEvent)

FireKeyEvent will fire the supplied keyboard event

func (*View) FireMouseEvent

func (view *View) FireMouseEvent(event *MouseEvent)

FireMouseEvent will fire the supplied mouse event

func (*View) FireScrollEvent

func (view *View) FireScrollEvent(event *ScrollEvent)

FireScrollEvent will fire the supplied scroll event

func (*View) GetBitmap

func (view *View) GetBitmap() *Bitmap

GetBitmap returns the bitmap representation of the View

func (*View) GetJSContext

func (view *View) GetJSContext() JSContext

GetJSContext gets the JSContext of the current page

func (*View) GetNeedsPaint

func (view *View) GetNeedsPaint() bool

GetNeedsPaint returns whether the View should be painted during the next call to Renderer.Render()

func (*View) GetTitle

func (view *View) GetTitle() string

GetTitle returns the current Title

func (*View) GetURL

func (view *View) GetURL() string

GetURL returns the current URL

func (*View) GoBack

func (view *View) GoBack()

GoBack navigates backwards through the View history

func (*View) GoForward

func (view *View) GoForward()

GoForward navigates forwards through the View history

func (*View) GoToHistoryOffset

func (view *View) GoToHistoryOffset(offset int)

GoToHistoryOffset navigates to the specified offset in the View history

func (*View) IsBitmapDirty

func (view *View) IsBitmapDirty() bool

IsBitmapDirty checks if the bitmap has changed since the last call to GetBitmap()

func (*View) IsLoading

func (view *View) IsLoading() bool

IsLoading checks if the main frame is loading

func (*View) JSBindBool

func (view *View) JSBindBool(val bool) *JSValue

JSBindBool will wrap a boolean value to be retuned by a bound Go function

func (*View) JSBindJSON

func (view *View) JSBindJSON(val string) *JSValue

JSBindJSON will wrap a JSON string value to be retuned by a bound Go function

func (*View) JSBindNum

func (view *View) JSBindNum(val float64) *JSValue

JSBindNum will wrap a numeric value to be retuned by a bound Go function

func (*View) JSBindString

func (view *View) JSBindString(val string) *JSValue

JSBindString will wrap a string value to be retuned by a bound Go function

func (*View) LoadHTML

func (view *View) LoadHTML(html string)

LoadHTML loads a raw string of HTML into the main frame

func (*View) LoadURL

func (view *View) LoadURL(url string)

LoadURL loads the specified URL into the main frame

func (*View) NeedsPaint

func (view *View) NeedsPaint(needsPaint bool)

NeedsPaint sets whether the View should be repainted during the next call to Renderer.Render()

func (*View) Reload

func (view *View) Reload()

Reload refreshes the current page

func (*View) Resize

func (view *View) Resize(width, height uint)

Resize changes the View dimensions to the specified width and height (in device coordinates)

func (*View) SetAddConsoleMessageCallback

func (view *View) SetAddConsoleMessageCallback(callFunc func(
	source MessageSource, level MessageLevel, message string, lineNumber uint, colNumber uint, sourceID string))

SetAddConsoleMessageCallback executes the specified function when a message is added to the console

func (*View) SetBeginLoadingCallback

func (view *View) SetBeginLoadingCallback(callFunc func())

SetBeginLoadingCallback executes the specified function when the page begins loading a new URL

func (*View) SetChangeCursorCallback

func (view *View) SetChangeCursorCallback(callFunc func(cursor Cursor))

SetChangeCursorCallback executes the specified function when the mouse cursor changes

func (*View) SetChangeTitleCallback

func (view *View) SetChangeTitleCallback(callFunc func(title string))

SetChangeTitleCallback executes the specified function when the page title changes

func (*View) SetChangeTooltipCallback

func (view *View) SetChangeTooltipCallback(callFunc func(tooltip string))

SetChangeTooltipCallback executes the specified function when the tooltip changes (usually due to a mouse hover)

func (*View) SetChangeURLCallback

func (view *View) SetChangeURLCallback(callFunc func(url string))

SetChangeURLCallback executes the specified function when the page URL changes

func (*View) SetDOMReadyCallback

func (view *View) SetDOMReadyCallback(callFunc func())

SetDOMReadyCallback executes the specified function when all JavaScript has been parsed and the document is ready

func (*View) SetFinishLoadingCallback

func (view *View) SetFinishLoadingCallback(callFunc func())

SetFinishLoadingCallback executes the specified function when the page finished loading a URL

func (*View) SetUpdateHistoryCallback

func (view *View) SetUpdateHistoryCallback(callFunc func())

SetUpdateHistoryCallback executes the specified function when the history (back/forward state) is modified

func (*View) Stop

func (view *View) Stop()

Stop terminates all page loads

type Window

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

Window wraps the underlying struct

func CreateWindow

func CreateWindow(m *Monitor, width, height uint, isTransparent bool, windowType WindowFlag) *Window

CreateWindow creates a new Window with the specified size (in device coordinates)

func (*Window) Close

func (win *Window) Close()

Close closes the Window

func (*Window) Destroy

func (win *Window) Destroy()

Destroy deletes the Window instance

func (*Window) DeviceToPixel

func (win *Window) DeviceToPixel(value int) int

DeviceToPixel converts device coordinates to pixels using the current DPI scale

func (*Window) GetHeight

func (win *Window) GetHeight() uint

GetHeight returns the height of the Window instance (in device coordinates)

func (*Window) GetScale

func (win *Window) GetScale() float64

GetScale returns the DPI scale of the Window as a percentage

func (*Window) GetWidth

func (win *Window) GetWidth() uint

GetWidth returns the width of the Window instance (in device coordinates)

func (*Window) IsFullscreen

func (win *Window) IsFullscreen() bool

IsFullscreen returns whether the Window is fullscreen

func (*Window) PixelsToDevice

func (win *Window) PixelsToDevice(value int) int

PixelsToDevice converts pixels to device coordinates using the current DPI scale

func (*Window) SetCloseCallback

func (win *Window) SetCloseCallback(callFunc func())

SetCloseCallback executes the specified function when the Window closes

func (*Window) SetCursor

func (win *Window) SetCursor(cursor Cursor)

SetCursor sets the cursor for the Window instance

func (*Window) SetResizeCallback

func (win *Window) SetResizeCallback(callFunc func(width uint, height uint))

SetResizeCallback executes the specified function when the Window is resized

func (*Window) SetTitle

func (win *Window) SetTitle(title string)

SetTitle sets the title of the Window instance

type WindowFlag

type WindowFlag int

WindowFlag enumerates the window features in a bitwise-OR ('|') friendly manner

const (
	WindowBorderless  WindowFlag = 1 << 0
	WindowTitled      WindowFlag = 1 << 1
	WindowResizable   WindowFlag = 1 << 2
	WindowMaximizable WindowFlag = 1 << 3
)

Feature flags for the Window instance

Jump to

Keyboard shortcuts

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