summaryrefslogtreecommitdiff
path: root/prefsize_darwin.go
diff options
context:
space:
mode:
Diffstat (limited to 'prefsize_darwin.go')
-rw-r--r--prefsize_darwin.go36
1 files changed, 15 insertions, 21 deletions
diff --git a/prefsize_darwin.go b/prefsize_darwin.go
index 4e10a6a..b37e6f6 100644
--- a/prefsize_darwin.go
+++ b/prefsize_darwin.go
@@ -10,46 +10,40 @@ Cocoa doesn't provide a reliable way to get the preferred size of a control (you
*/
// standard case: control immediately passed in
-func controlPrefSize(control C.id, alternate C.BOOL) (width int, height int, yoff int) {
- r := C.controlPrefSize(control, alternate)
- return int(r.width), int(r.height), int(r.yoff)
-}
-
-// Labels have special yoff calculation
-func labelPrefSize(control C.id, alternate C.BOOL) (width int, height int, yoff int) {
- r := C.labelPrefSize(control, alternate)
- return int(r.width), int(r.height), int(r.yoff)
+func controlPrefSize(control C.id) (width int, height int) {
+ r := C.controlPrefSize(control)
+ return int(r.width), int(r.height)
}
// NSTableView is actually in a NSScrollView so we have to get it out first
-func listboxPrefSize(control C.id, alternate C.BOOL) (width int, height int, yoff int) {
+func listboxPrefSize(control C.id) (width int, height int) {
r := C.listboxPrefSize(control, alternate)
- return int(r.width), int(r.height), int(r.yoff)
+ return int(r.width), int(r.height)
}
// and for type checking reasons, progress bars are separate despite responding to -[sizeToFit]
-func pbarPrefSize(control C.id, alternate C.BOOL) (width int, height int, yoff int) {
- r := C.pbarPrefSize(control, alternate)
- return int(r.width), int(r.height), int(r.yoff)
+func pbarPrefSize(control C.id) (width int, height int) {
+ r := C.pbarPrefSize(control)
+ return int(r.width), int(r.height)
}
// Areas know their own preferred size
-func areaPrefSize(control C.id, alternate C.BOOL) (width int, height int, yoff int) {
- r := C.areaPrefSize(control, alternate)
- return int(r.width), int(r.height), int(r.yoff)
+func areaPrefSize(control C.id) (width int, height int) {
+ r := C.areaPrefSize(control)
+ return int(r.width), int(r.height)
}
-var prefsizefuncs = [nctypes]func(C.id, C.BOOL) (int, int, int){
+var prefsizefuncs = [nctypes]func(C.id) (int, int){
c_button: controlPrefSize,
c_checkbox: controlPrefSize,
c_combobox: controlPrefSize,
c_lineedit: controlPrefSize,
- c_label: labelPrefSize,
+ c_label: controlPrefSize,
c_listbox: listboxPrefSize,
c_progressbar: pbarPrefSize,
c_area: areaPrefSize,
}
-func (s *sysData) preferredSize() (width int, height int, yoff int) {
- return prefsizefuncs[s.ctype](s.id, toBOOL(s.alternate))
+func (s *sysData) preferredSize() (width int, height int) {
+ return prefsizefuncs[s.ctype](s.id)
}