swig/Examples/go/callback/runme.go
Michael Schaller 85037c3a33 [Go] Updated the 'callback' and 'extend' examples to match the 'director' one.
After the documentation update on how to utilize the director feature with
commit @17b1c1c the 'callback' and 'extend' examples needed an update as well.
2015-08-09 14:37:16 +02:00

33 lines
587 B
Go

package main
import (
. "./example"
"fmt"
)
func main() {
fmt.Println("Adding and calling a normal C++ callback")
fmt.Println("----------------------------------------")
caller := NewCaller()
callback := NewCallback()
caller.SetCallback(callback)
caller.Call()
caller.DelCallback()
go_callback := NewGoCallback()
fmt.Println()
fmt.Println("Adding and calling a Go callback")
fmt.Println("--------------------------------")
caller.SetCallback(go_callback)
caller.Call()
caller.DelCallback()
DeleteGoCallback(go_callback)
fmt.Println()
fmt.Println("Go exit")
}