trayhost

package module
v0.0.0-...-653fb4f Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2015 License: MIT Imports: 10 Imported by: 0

README

trayhost

Cross-platform Go library to place an icon in the host operating system's taskbar.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnterLoop

func EnterLoop()

func Exit

func Exit()

func GetClipboardString

func GetClipboardString() (string, error)

GetClipboardString returns the contents of the system clipboard, if it contains or is convertible to a UTF-8 encoded string.

This function may only be called from the main thread.

func Initialize

func Initialize(title string, imageData []byte, items []MenuItem)

Run the host system's event loop.

func InvertImageNrgba

func InvertImageNrgba(nrgba *image.NRGBA)

func SetClipboardString

func SetClipboardString(str string)

SetClipboardString sets the system clipboard to the specified UTF-8 encoded string.

This function may only be called from the main thread.

Types

type Image

type Image struct {
	Kind  ImageKind
	Bytes []byte
}

func GetClipboardImage

func GetClipboardImage() (Image, error)

GetClipboardString returns the contents of the system clipboard, if it contains or is convertible to an image.

This function may only be called from the main thread.

type ImageKind

type ImageKind uint8
const (
	ImageKindNone ImageKind = iota
	ImageKindPng
	ImageKindTiff
)
type MenuItem struct {
	Title   string
	Enabled func() bool // nil means always enabled.
	Handler func()
}

func SeparatorMenuItem

func SeparatorMenuItem() MenuItem

Creates a separator MenuItem.

type Notification

type Notification struct {
	Title string // Title of user notification.
	Body  string // Body of user notification.
	Image Image  // Image shown in the content of user notification.

	// Timeout specifies time after which the notification is cleared.
	//
	// A Timeout of zero means no timeout.
	Timeout time.Duration

	// Activation (click) handler.
	Handler func()
}

Notification represents a user notification.

func (Notification) Display

func (n Notification) Display()

Display displays the user notification.

Jump to

Keyboard shortcuts

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