summaryrefslogtreecommitdiff
path: root/redo/sizer_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-02 09:47:57 -0400
committerPietro Gagliardi <[email protected]>2014-08-02 09:47:57 -0400
commitc6e47ba21abc5b67f034f3f244c91d415ad571db (patch)
tree9ad2985903efd7a53a46599363b47160e7dab664 /redo/sizer_darwin.go
parent85fb097ab97603ff2539ec7a3abd6ae8b96a44cb (diff)
Migrated the Label alignment code back into the Mac OS X port.
Diffstat (limited to 'redo/sizer_darwin.go')
-rw-r--r--redo/sizer_darwin.go50
1 files changed, 1 insertions, 49 deletions
diff --git a/redo/sizer_darwin.go b/redo/sizer_darwin.go
index 1aa345a..500d35f 100644
--- a/redo/sizer_darwin.go
+++ b/redo/sizer_darwin.go
@@ -12,7 +12,7 @@ type sizing struct {
// nothing for mac
// for the actual resizing
-// neighborAlign C.struct_xalignment
+ neighborAlign C.struct_xalignment
}
// THIS IS A GUESS. TODO.
@@ -42,51 +42,3 @@ func (s *sizer) translateAllocationCoords(allocations []*allocation, winwidth, w
a.y = (winheight - a.y) - a.height
}
}
-
-/*
-Cocoa doesn't provide a reliable way to get the preferred size of a control (you're supposed to use Interface Builder and have it set up autoresizing for you). The best we can do is call [control sizeToFit] (which is defined for NSControls and has a custom implementation for the other types here) and read the preferred size. Though this changes the size, we're immediately overriding the change on return from sysData.preferredSize(), so no harm done. (This is similar to what we are doing with GTK+, except GTK+ does not actually change the size.)
-*/
-
-//TODO
-/*
-// standard case: control immediately passed in
-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) (width int, height int) {
- r := C.listboxPrefSize(control)
- 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) (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) (width int, height int) {
- r := C.areaPrefSize(control)
- return int(r.width), int(r.height)
-}
-
-var prefsizefuncs = [nctypes]func(C.id) (int, int){
- c_button: controlPrefSize,
- c_checkbox: controlPrefSize,
- c_combobox: controlPrefSize,
- c_lineedit: controlPrefSize,
- c_label: controlPrefSize,
- c_listbox: listboxPrefSize,
- c_progressbar: pbarPrefSize,
- c_area: areaPrefSize,
-}
-*/
-
-//func (w *widgetbase) preferredSize(d *sizing) (width int, height int) {
-//TODO
-// return prefsizefuncs[s.ctype](s.id)
-//return 0,0
-//}