diff options
| author | Pietro Gagliardi <[email protected]> | 2015-12-11 20:37:59 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-12-11 20:37:59 -0500 |
| commit | f8e3f12ab02b528f2a05a4f713d7af7ea8e44b42 (patch) | |
| tree | 82dedf4d37f0f6d31e88ebb2ca1ce6499dead261 /prev/textbox_darwin.go | |
| parent | e34c561ed5bedeb180437ec165882b98d70d38c1 (diff) | |
LET'S GET THIS FINAL REWRITE EVER STARTED
Diffstat (limited to 'prev/textbox_darwin.go')
| -rw-r--r-- | prev/textbox_darwin.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/prev/textbox_darwin.go b/prev/textbox_darwin.go new file mode 100644 index 0000000..0ad47f6 --- /dev/null +++ b/prev/textbox_darwin.go @@ -0,0 +1,33 @@ +// 24 october 2014 + +package ui + +import ( + "unsafe" +) + +// #include "objc_darwin.h" +import "C" + +type textbox struct { + *scroller +} + +func newTextbox() Textbox { + id := C.newTextbox() + t := &textbox{ + scroller: newScroller(id, true), // border on Textbox (TODO confirm type) + } + // TODO preferred size + return t +} + +func (t *textbox) Text() string { + return C.GoString(C.textboxText(t.id)) +} + +func (t *textbox) SetText(text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + C.textboxSetText(t.id, ctext) +} |
