systray

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

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

Go to latest
Published: Mar 15, 2017 License: MIT Imports: 13 Imported by: 1

README

Modified to directly invoke objc via cgo for darwin. This adds a tray_darwin.c source file and blends the original systray.Client standalone app functionality with that of the cgo-compiled integrated objc from github.com/cratonica/trayhost (which did a dock icon/menu for darwin and required cgo for all platforms).

This carries two important ramifications:

  1. Darwin app (and linux, eventually) must be compiled on target platform (or cross-compiled for cgo, when/if that happens officially)
  2. Systray.Run() must be executed on the main thread in order to play nice with Cocoa

Also includes support for adding menu items with Go callbacks.

[================== original content below ======================]

Systray (Trayicon/Menu Extras)

Cross platform systray for golang

Instead of gui program, "go-program + systray + web-console" might be a interesting choise.

Platform

Mac: avalid
Win: avalid
Linux: coming soon

Run example

Mac:

cd example
go run icons/mac systray

How it works

Win:
[your code in go] -> [systray: win32 api call in go]

Mac:
[your code in go] -> [systray.Server in go] -(tcp)-> [systray.Client in objc]

Linux:
[your code in go] -> [systray.Server in go] -(tcp)-> [systray.Client in c]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackInfo

type CallbackInfo struct {
	ItemName string
	Callback func()
	Disabled bool
	Checked  bool
}

type Systray

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

func New

func New(iconPath string, clientPath string) *Systray

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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