summaryrefslogtreecommitdiff
path: root/group_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-30 23:02:02 -0400
committerPietro Gagliardi <[email protected]>2014-08-30 23:02:02 -0400
commit77bf566ebbcb62acd4d08d905d9542d6ff9b6b80 (patch)
treeeeb8e72bc3bf57f5be7f0c0af4319189ac6de838 /group_darwin.go
parent155899c65ed32245e2ccad4197a10c77017d835b (diff)
...in with the new.
Diffstat (limited to 'group_darwin.go')
-rw-r--r--group_darwin.go58
1 files changed, 58 insertions, 0 deletions
diff --git a/group_darwin.go b/group_darwin.go
new file mode 100644
index 0000000..788ba83
--- /dev/null
+++ b/group_darwin.go
@@ -0,0 +1,58 @@
+// 16 august 2014
+
+package ui
+
+import (
+ "unsafe"
+)
+
+// #include "objc_darwin.h"
+import "C"
+
+type group struct {
+ _id C.id
+
+ *container
+}
+
+func newGroup(text string, control Control) Group {
+ g := new(group)
+ g.container = newContainer(control)
+ g._id = C.newGroup(g.container.id)
+ g.SetText(text)
+ return g
+}
+
+func (g *group) Text() string {
+ return C.GoString(C.groupText(g._id))
+}
+
+func (g *group) SetText(text string) {
+ ctext := C.CString(text)
+ defer C.free(unsafe.Pointer(ctext))
+ C.groupSetText(g._id, ctext)
+}
+
+func (g *group) id() C.id {
+ return g._id
+}
+
+func (g *group) setParent(p *controlParent) {
+ basesetParent(g, p)
+}
+
+func (g *group) allocate(x int, y int, width int, height int, d *sizing) []*allocation {
+ return baseallocate(g, x, y, width, height, d)
+}
+
+func (g *group) preferredSize(d *sizing) (width, height int) {
+ return basepreferredSize(g, d)
+}
+
+func (g *group) commitResize(a *allocation, d *sizing) {
+ basecommitResize(g, a, d)
+}
+
+func (g *group) getAuxResizeInfo(d *sizing) {
+ basegetAuxResizeInfo(g, d)
+}