项目作者: asticode

项目描述 :
Cross platform splash screen
高级语言: Go
项目地址: git://github.com/asticode/go-astisplash.git
创建时间: 2017-06-25T09:56:23Z
项目社区:https://github.com/asticode/go-astisplash

开源协议:MIT License

下载


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:

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

Usage

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

  1. // Build splasher
  2. s, _ := astisplash.New()
  3. defer s.Close()
  4. // Splash
  5. sp, _ := s.Splash("/path/to/your/image.png", 160, 90)
  6. // Sleep
  7. time.Sleep(2 * time.Second)
  8. // Close the splash
  9. sp.Close()

Example

Run the following command to see the example:

  1. $ go run example/main.go -v

Developments

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

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