Beispiel #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)
}
Beispiel #2
0
func NewItem(name string, desc string) *Item {
	return (*Item)(C.new_item(C.CString(name), C.CString(desc)))
}
Beispiel #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))}
}