MCPcopy Create free account
hub / github.com/andlabs/ui / NewButton

Function NewButton

button.go:22–33  ·  view source on GitHub ↗

NewButton creates a new Button with the given text as its label.

(text string)

Source from the content-addressed store, hash-verified

20
21// NewButton creates a new Button with the given text as its label.
22func NewButton(text string) *Button {
23 b := new(Button)
24
25 ctext := C.CString(text)
26 b.b = C.uiNewButton(ctext)
27 freestr(ctext)
28
29 C.pkguiButtonOnClicked(b.b)
30
31 b.ControlBase = NewControlBase(b, uintptr(unsafe.Pointer(b.b)))
32 return b
33}
34
35// Text returns the Button's text.
36func (b *Button) Text() string {

Callers

nothing calls this directly

Calls 2

freestrFunction · 0.85
NewControlBaseFunction · 0.85

Tested by

no test coverage detected