|
|
@ -1,9 +1,11 @@ |
|
|
|
|
|
|
|
package main |
|
|
|
|
|
|
|
import ( |
|
|
|
"github.com/lxn/walk" |
|
|
|
"log" |
|
|
|
) |
|
|
|
func GuiInit() { |
|
|
|
|
|
|
|
func main() { |
|
|
|
mw, err := walk.NewMainWindow() |
|
|
|
if err != nil { |
|
|
|
log.Fatal(err) |
|
|
@ -24,14 +26,14 @@ func GuiInit() { |
|
|
|
if err := ni.SetToolTip("鼠标在icon上悬浮的信息."); err != nil { |
|
|
|
log.Fatal(err) |
|
|
|
} |
|
|
|
ni.MouseDown().Attach(func(x, yint, button walk.MouseButton) { |
|
|
|
if button != walk.LeftButton { |
|
|
|
return |
|
|
|
} |
|
|
|
if err := ni.ShowCustom("Walk 任务栏通知标题","walk 任务栏通知内容"); err != nil { |
|
|
|
og.Fatal(err) |
|
|
|
} |
|
|
|
}) |
|
|
|
//ni.MouseDown().Attach(func(x, yint, button walk.MouseButton) {
|
|
|
|
// if button != walk.LeftButton {
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// if err := ni.ShowCustom("Walk 任务栏通知标题","walk 任务栏通知内容"); err != nil {
|
|
|
|
// log.Fatal(err)
|
|
|
|
// }
|
|
|
|
//})
|
|
|
|
exitAction := walk.NewAction() |
|
|
|
if err := exitAction.SetText("右键icon的菜单按钮"); err != nil { |
|
|
|
log.Fatal(err) |