forked from andlabs/ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
group_darwin.go
58 lines (44 loc) · 1.01 KB
/
group_darwin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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)
}