func AddCheckMenuItem(sName string, id int, fu func([]string) string, sCode string, params ...string) {
	if sMenu[len(sMenu)-1] != '[' {
		sMenu += ","
	}
	sMenu += "[\"" + sName + "\"," + getscode(fu, sCode, params...) + "," + strconv.Itoa(id) + ",true]"
}
AddCheckMenuItem is the same as AddMenuItem, but it creates a menu item, which may be checked.
In fact, it is needed in a GTK version only, but for the sake of compatibility it is
recommended to use it in your code if this is a check menu item.
package external
import (
	"strconv"
	"encoding/json"
)
var sMenu = ""
var iStackLen = 0
func Menu(sTitle string) {
	if sMenu == "" {
		sMenu = "[\"menu\",["
	} else {
		if sMenu[len(sMenu)-1] != '[' {
			sMenu += ","
		}
		sMenu += "[\"" + sTitle + "\",["
		iStackLen++
	}
}
func MenuContext(sName string) {
	if sMenu == "" {
		sMenu = "[\"menucontext\",\"create\",\"" + sName + "\",["
	}
}
func ShowMenuContext(sName string, pWnd *Widget) {
	var sWndName string
	if pWnd == nil {
		sWndName = ""
	} else {
		sWndName = pWnd.Name
	}
	sendout("[\"menucontext\",\"show\",\"" + sName + "\",\"" + sWndName + "\"]")
}
func EndMenu() {
	sMenu += "]]"
	if iStackLen == 0 {
		sendout(sMenu)
		sMenu = ""
	} else {
		iStackLen--
	}
}
func getscode(fu func([]string) string, sCode string, params ...string) string {
	if fu != nil {
		RegFunc(sCode, fu)
		sCode = "pgo(\"" + sCode + "\",{\"menu\""
		for _, v := range params {
			sCode += ",\"" + v + "\""
		}
		sCode += "})"
	}
	b, _ := json.Marshal(sCode)
	return string(b)
}
func AddMenuItem(sName string, id int, fu func([]string) string, sCode string, params ...string) {
	if sMenu[len(sMenu)-1] != '[' {
		sMenu += ","
	}
	sMenu += "[\"" + sName + "\"," + getscode(fu, sCode, params...) + "," + strconv.Itoa(id) + "]"
}