Socket
Socket
Sign inDemoInstall

github.com/martin-angelov1992/gocarousel

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/martin-angelov1992/gocarousel


Version published

Readme

Source

GoCarousel

A Go library that allows you to place in your Graphical Application a custom carousel. You can specify:

  • The images to rotate.
  • Whether to select the next image in rotation randomly. Current image is excluded from random selection.
  • The animation. The available animations are:
    • Rotate right to left
    • Rotate left to right
    • Rotate up to down
    • Rotate down to up
  • Interval between switching images.
  • Speed of transition.
  • Position of the carousel.
  • Width and height of the carousel.

Installation on Linux

$ sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
$ sudo apt-get update
$ sudo apt-get install ubuntu-sdk qtbase5-private-dev qtdeclarative5-private-dev
$ go get github.com/martin-angelov1992/GoCarousel

For other operating systems if you manage to install qml you should be able to use the library.

Example

package main

import (
	"github.com/niemeyer/qml"
	"github.com/martin-angelov1992/GoCarousel"
)

func main() {
	qml.Init(nil)
	engine := qml.NewEngine()
	base, _ := engine.LoadFile("base.qml") // Where base.qml is an example qml file to add carousel to
	win := base.CreateWindow(nil)
	carousel := GoCarousel.NewCarousel(engine, win)
	carousel.SetImages([]string{"../test_images/ubuntu-gopher.png", "../test_images/firefox.png", "../test_images/fire.jpg"})
	carousel.SetWidth(200)
	carousel.SetHeight(GoCarousel.CALCULATE_DIMENSION) // Height will be calculated to keep aspect ratio
	win.Show()
	carousel.Run()
	win.Wait()
}

License

Apache license

FAQs

Last updated on 03 Feb 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc