From 30c3ee1b98702b56a95637e99d1bd97ca1e07ecf Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 5 Apr 2014 22:51:01 -0400 Subject: [PATCH] Gave Listboxes a border on Mac OS X. That just leaves GTK+: oyxgen-gtk always gives GtkScrollingWindows a border, which misled me earlier... other themes don't. --- listbox_darwin.go | 6 ++++++ todo.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/listbox_darwin.go b/listbox_darwin.go index bf05b3c..2bc724e 100644 --- a/listbox_darwin.go +++ b/listbox_darwin.go @@ -193,16 +193,22 @@ var ( _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 { + const ( + _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)) + 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 } diff --git a/todo.md b/todo.md index 7eecfd1..4bbbcfb 100644 --- a/todo.md +++ b/todo.md @@ -1,5 +1,5 @@ so I don't forget: -- [all platforms except Windows] Listbox should have a border style +- [GTK+] Listbox should have a border style - should Labels be selectable? - should message box text be selectable on all platforms or only on those that make it the default? - Message boxes should not show secondary text if none is specified. [TODO figure out what I meant by this]