summaryrefslogtreecommitdiff
path: root/listbox_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-13 12:52:10 -0400
committerPietro Gagliardi <[email protected]>2014-04-13 12:52:10 -0400
commit417bdb89492dc1eb2ca53535fd9891e3cb5bb7d7 (patch)
tree7e1142265c6130a130c740001cfa729b18d3e19d /listbox_darwin.go
parent136ddf5a5ba68aded74df105ad5b0d37026cc7ea (diff)
Consolidated NSScrollView code on Mac OS X to be all in one place.
Diffstat (limited to 'listbox_darwin.go')
-rw-r--r--listbox_darwin.go18
1 files changed, 4 insertions, 14 deletions
diff --git a/listbox_darwin.go b/listbox_darwin.go
index b5f26a8..7d10a5f 100644
--- a/listbox_darwin.go
+++ b/listbox_darwin.go
@@ -185,17 +185,12 @@ func listboxTableColumn(listbox C.id) C.id {
/*
The NSTableViews don't draw their own scrollbars; we have to drop our NSTableViews in NSScrollViews for this. The NSScrollView is also what provides the Listbox's border.
+
+The actual creation code was moved to objc_darwin.go.
*/
var (
- _NSScrollView = objc_getClass("NSScrollView")
-
- _setHasHorizontalScroller = sel_getUid("setHasHorizontalScroller:")
- _setHasVerticalScroller = sel_getUid("setHasVerticalScroller:")
- _setAutohidesScrollers = sel_getUid("setAutohidesScrollers:")
_setBorderType = sel_getUid("setBorderType:")
- _setDocumentView = sel_getUid("setDocumentView:")
- _documentView = sel_getUid("documentView")
)
func newListboxScrollView(listbox C.id) C.id {
@@ -203,18 +198,13 @@ func newListboxScrollView(listbox C.id) C.id {
_NSBezelBorder = 2
)
- scrollview := C.objc_msgSend_noargs(_NSScrollView, _alloc)
- scrollview = initWithDummyFrame(scrollview)
- C.objc_msgSend_bool(scrollview, _setHasHorizontalScroller, C.BOOL(C.YES))
- C.objc_msgSend_bool(scrollview, _setHasVerticalScroller, C.BOOL(C.YES))
- C.objc_msgSend_bool(scrollview, _setAutohidesScrollers, C.BOOL(C.YES))
+ scrollview := newScrollView(listbox)
C.objc_msgSend_uint(scrollview, _setBorderType, _NSBezelBorder) // this is what Interface Builder gives the scroll view
- C.objc_msgSend_id(scrollview, _setDocumentView, listbox)
return scrollview
}
func listboxInScrollView(scrollview C.id) C.id {
- return C.objc_msgSend_noargs(scrollview, _documentView)
+ return getScrollViewContent(scrollview)
}
/*