Currently there seems to be no way to easily access the parameter given to an action. I was able to figure out I can unsafe-cast the pointer to a variant, but ideally the callback function would type the parameter with a *glib.Variant instead.
Current Solution
action := gio.NewSimpleAction("win.some-action", glib.NewVariantType("x"))
action.ConnectActivate(g.Ptr(func(action gio.SimpleAction, parameter uintptr) {
variant := (*glib.Variant)(unsafe.Pointer(parameter))
id := variant.GetInt64()
fmt.Println(id)
}))
w.AddAction(action)
Ideal Solution
action := gio.NewSimpleAction("win.some-action", glib.NewVariantType("x"))
action.ConnectActivate(g.Ptr(func(action gio.SimpleAction, parameter *glib.Variant) {
id := parameter.GetInt64()
fmt.Println(id)
}))
w.AddAction(action)
(g.Ptr is a helper I made, it just makes a pointer to whatever is passed in)