<commit_before>package systemtray

import (
    "C"
    . "../capi"
    "fmt"
    "unsafe"
)

func TimeCallback(x C.int) { fmt.Println("time callback", x) }
func DTimeCallback(x C.int) { fmt.Println("dtime callback", x) }
func IconActivatedCallback(x C.int) { fmt.Println("icon callback", x) }
func RunAtStartupCallback(x C.int) { fmt.Println("run at startup callback", x) }

func Run() {

    NewGuiApplication()

    systray := GetSystemTray()
    systray.SetIcon("static_source/images/icons/watch-red.png")
    systray.SetToolTip("Watcher")
    systray.SetVisible(true)

    var TimeCallbackFunc = TimeCallback
    var DTimeCallbackFunc = DTimeCallback
    var IconActivatedCallbackFunc = IconActivatedCallback
    var RunAtStartupCallbackFunc = RunAtStartupCallback

    systray.SetTimeCallback(unsafe.Pointer(&TimeCallbackFunc))
    systray.SetDTimeCallback(unsafe.Pointer(&DTimeCallbackFunc))
    systray.SetIconActivatedCallback(unsafe.Pointer(&IconActivatedCallbackFunc))
    systray.SetRunAtStartupCallback(unsafe.Pointer(&RunAtStartupCallbackFunc))

    systray.SetTime(45 * 60)
    systray.SetDTime(45 * 60)
    systray.SetAlarm(2)
    systray.SetAlarmInfo("test msg")

    ApplicationExec()
}
<commit_msg>save to settings<commit_after>package systemtray

import (
    "C"
    . "../capi"
    "fmt"
    "unsafe"
    settings "../settings"
)

var (
    stPtr *settings.Settings
)

func TimeCallback(x C.int) { fmt.Println("time callback", x) }
func DTimeCallback(x C.int) { fmt.Println("dtime callback", x) }
func IconActivatedCallback(x C.int) { fmt.Println("icon callback", x) }
func RunAtStartupCallback(x C.int) { fmt.Println("run at startup callback", x) }

func Run() {

    NewGuiApplication()

    systray := GetSystemTray()
    stPtr.SysTray = systray
    systray.SetIcon("static_source/images/icons/watch-red.png")
    systray.SetToolTip("Watcher")
    systray.SetVisible(true)

    var TimeCallbackFunc = TimeCallback
    var DTimeCallbackFunc = DTimeCallback
    var IconActivatedCallbackFunc = IconActivatedCallback
    var RunAtStartupCallbackFunc = RunAtStartupCallback

    systray.SetTimeCallback(unsafe.Pointer(&TimeCallbackFunc))
    systray.SetDTimeCallback(unsafe.Pointer(&DTimeCallbackFunc))
    systray.SetIconActivatedCallback(unsafe.Pointer(&IconActivatedCallbackFunc))
    systray.SetRunAtStartupCallback(unsafe.Pointer(&RunAtStartupCallbackFunc))

    systray.SetTime(45 * 60)
    systray.SetDTime(45 * 60)
    systray.SetAlarm(2)
    systray.SetAlarmInfo("test msg")

    ApplicationExec()
}

func init() {
    stPtr = settings.SettingsPtr()
}
{'fraction_non_alphanumeric': 0.11507167764432391, 'fraction_numerical': 0.006974041069352964, 'mean_word_length': 4.481953290870488, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4306173', 'n_tokens_mistral': 863, 'n_tokens_neox': 853, 'n_words': 143}