astisplash

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

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

Go to latest
Published: Feb 11, 2018 License: MIT Imports: 8 Imported by: 0

README

This package provides a way to display a cross-platform splash screen without having to feel the pain of cross compiling.

Indeed, instead of using CGO that would require to install each and every tool chains in order to cross compile, this package relies on executing already cross-compiled binaries that are embedded directly in GO.

Disclaimer

For now it doesn't work on Windows unfortunately :(

Installation

Run the following command:

$ go get -u github.com/asticode/go-astisplash

Usage

WARNING: the code below doesn't handle errors for readibility purposes. However you SHOULD!

// Build splasher
s, _ := astisplash.New()
defer s.Close()

// Splash
sp, _ := s.Splash("/path/to/your/image.png", 160, 90)

// Sleep
time.Sleep(2 * time.Second)

// Close the splash
sp.Close()

Example

Run the following command to see the example:

$ go run example/main.go -v

Developments

When modifying the C code, you'll have to run the following:

$ cd $GOPATH/src/github.com/asticode/go-astisplash
$ make

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Splash

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

Splash represents a splash screen

func (*Splash) Close

func (s *Splash) Close() (err error)

Close closes the splash screen properly

type Splasher

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

Splasher represents an object capable of displaying splash screens

func New

func New() (s *Splasher, err error)

New creates a new splasher

func (*Splasher) Close

func (s *Splasher) Close() (err error)

Close closes the Splasher properly

func (*Splasher) Splash

func (s *Splasher) Splash(src string, width, height int) (*Splash, error)

Splash displays a splash screen

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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