🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

github.com/animationmentor/systray

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/animationmentor/systray

v0.0.0-20170315183212-ff8a0587d8b6
Source
Go
Version published
Created
Source

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:

  • Darwin app (and linux, eventually) must be compiled on target platform (or cross-compiled for cgo, when/if that happens officially)
  • 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]

FAQs

Package last updated on 15 Mar 2017

Did you know?

Socket

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