forked from silvrwolfboy/macdriver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNSView.go
68 lines (52 loc) · 1.35 KB
/
NSView.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
59
60
61
62
63
64
65
66
67
68
package cocoa
import (
"github.com/progrium/macdriver/core"
"github.com/progrium/macdriver/objc"
)
type NSView struct {
gen_NSView
}
func NSView_Init(frame core.NSRect) NSView {
return NSView_alloc().InitWithFrame__asNSView(frame)
}
func (v NSView) SetBackgroundColor(color NSColor) {
v.SetBackgroundColor_(color)
}
func (v NSView) SetWantsLayer(b bool) {
v.SetWantsLayer_(b)
}
func (v NSView) AddSubviewPositionedRelativeTo(subview NSViewRef, positioned int, relativeTo NSViewRef) {
v.AddSubview_positioned_relativeTo_(subview, core.NSUInteger(positioned), relativeTo)
}
func (v NSView) AddSubview(subview NSViewRef) {
v.AddSubview_(subview)
}
func (v NSView) SetFrameOrigin(p core.NSPoint) {
v.SetFrameOrigin_(p)
}
func (v NSView) SetFrameSize(s core.NSSize) {
v.SetFrameSize_(s)
}
func (v NSView) SetFrame(r core.NSRect) {
v.SetFrame_(r)
}
func (v NSView) SetBoundsOrigin(p core.NSPoint) {
v.SetBoundsOrigin_(p)
}
func (v NSView) SetBoundsSize(s core.NSSize) {
v.SetBoundsSize_(s)
}
func (v NSView) SetBounds(r core.NSRect) {
v.SetBounds_(r)
}
func (v NSView) SetOpaque(b bool) {
// TODO NSView declares this property as `readonly`, do we really need this
// setter?
v.Set("opaque:", b)
}
func (v NSView) Opaque() bool {
return v.IsOpaque()
}
func (v NSView) SetValueForKey(value, key objc.Object) {
v.Send("setValue:forKey:", value, key)
}