Esempio n. 1
0
func newButton(text string) *button {
	ctext := C.CString(text)
	defer C.free(unsafe.Pointer(ctext))
	b := &button{
		controlSingleObject: newControlSingleObject(C.newButton()),
		clicked:             newEvent(),
	}
	C.buttonSetText(b.id, ctext)
	C.buttonSetDelegate(b.id, unsafe.Pointer(b))
	return b
}
Esempio n. 2
0
func newButton(text string) *button {
	ctext := C.CString(text)
	defer C.free(unsafe.Pointer(ctext))
	b := &button{
		_id:     C.newButton(),
		clicked: newEvent(),
	}
	C.buttonSetText(b._id, ctext)
	C.buttonSetDelegate(b._id, unsafe.Pointer(b))
	return b
}