Exemplo n.º 1
0
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
}
Exemplo n.º 2
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
}
Exemplo n.º 3
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
}
Exemplo n.º 4
0
func (c *checkbox) SetText(text string) {
	ctext := C.CString(text)
	defer C.free(unsafe.Pointer(ctext))
	C.buttonSetText(c.id, ctext)
}
Exemplo n.º 5
0
func (b *button) SetText(text string) {
	ctext := C.CString(text)
	defer C.free(unsafe.Pointer(ctext))
	C.buttonSetText(b.id, ctext)
}
Exemplo n.º 6
0
		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) {