diff options
| author | Pietro Gagliardi <[email protected]> | 2018-08-26 09:55:07 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2018-08-26 09:55:07 -0400 |
| commit | 62ac2527732a01dfa6bd2c9523215c0ba3816641 (patch) | |
| tree | 84244a69e048f79e4d9f134c121f4cf581200986 /label.go | |
| parent | a5a00c644c08a6e0f52740c3f2a280977929a285 (diff) | |
Moved all the Go files out of the way again, this time so we can migrate them to more proper cgo usage.
Diffstat (limited to 'label.go')
| -rw-r--r-- | label.go | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/label.go b/label.go deleted file mode 100644 index cac7680..0000000 --- a/label.go +++ /dev/null @@ -1,44 +0,0 @@ -// 12 december 2015 - -package ui - -import ( - "unsafe" -) - -// #include "ui.h" -import "C" - -// Label is a Control that represents a line of text that cannot be -// interacted with. -type Label struct { - ControlBase - l *C.uiLabel -} - -// NewLabel creates a new Label with the given text. -func NewLabel(text string) *Label { - l := new(Label) - - ctext := C.CString(text) - l.l = C.uiNewLabel(ctext) - freestr(ctext) - - l.ControlBase = NewControlBase(l, uintptr(unsafe.Pointer(l.l))) - return l -} - -// Text returns the Label's text. -func (l *Label) Text() string { - ctext := C.uiLabelText(l.l) - text := C.GoString(ctext) - C.uiFreeText(ctext) - return text -} - -// SetText sets the Label's text to text. -func (l *Label) SetText(text string) { - ctext := C.CString(text) - C.uiLabelSetText(l.l, ctext) - freestr(ctext) -} |
