func newCheckbox(text string) *checkbox { ctext := C.CString(text) defer C.free(unsafe.Pointer(ctext)) c := &checkbox{ controlSingleObject: newControlSingleObject(C.newCheckbox()), toggled: newEvent(), } C.buttonSetText(c.id, ctext) C.checkboxSetDelegate(c.id, unsafe.Pointer(c)) return c }
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 }
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 }
func (c *checkbox) SetText(text string) { ctext := C.CString(text) defer C.free(unsafe.Pointer(ctext)) C.buttonSetText(c.id, ctext) }
func (b *button) SetText(text string) { ctext := C.CString(text) defer C.free(unsafe.Pointer(ctext)) C.buttonSetText(b.id, ctext) }
text: func(what C.id, alternate bool) C.id { return C.windowTitle(what) }, }, c_button: &classData{ make: func(parentWindow C.id, alternate bool, s *sysData) C.id { button := C.makeButton() C.buttonSetTargetAction(button, appDelegate) applyStandardControlFont(button) addControl(parentWindow, button) return button }, show: controlShow, hide: controlHide, settext: func(what C.id, text C.id) { C.buttonSetText(what, text) }, text: func(what C.id, alternate bool) C.id { return C.buttonText(what) }, }, c_checkbox: &classData{ make: func(parentWindow C.id, alternate bool, s *sysData) C.id { checkbox := C.makeCheckbox() applyStandardControlFont(checkbox) addControl(parentWindow, checkbox) return checkbox }, show: controlShow, hide: controlHide, settext: func(what C.id, text C.id) {