summaryrefslogtreecommitdiff
path: root/listbox_darwin.go
diff options
context:
space:
mode:
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)
}
/*