Ejemplo n.º 1
0
// NewItem creates a new menu item with name and description.
func NewItem(name, desc string) (*MenuItem, error) {
	cname := C.CString(name)
	cdesc := C.CString(desc)

	var item *C.ITEM
	var err error
	item, err = C.new_item(cname, cdesc)
	return &MenuItem{item}, ncursesError(err)
}
Ejemplo n.º 2
0
func NewItem(name string, desc string) *Item {
	return (*Item)(C.new_item(C.CString(name), C.CString(desc)))
}
Ejemplo n.º 3
0
func NewItem(name string, desc string) *Item { //Memory Leaks: do something about it sometime
	return &Item{C.new_item(C.CString(name), C.CString(desc))}
}