From f5397475469b8e5b7a42d0bbb9bda4bca97f2b8a Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 6 Jun 2014 23:03:29 -0400 Subject: Set Area's preferred size in the documentation and on Windows and Mac OS X. --- prefsize_darwin.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'prefsize_darwin.m') diff --git a/prefsize_darwin.m b/prefsize_darwin.m index 521b767..2f3dd7a 100644 --- a/prefsize_darwin.m +++ b/prefsize_darwin.m @@ -72,4 +72,18 @@ struct xsize pbarPrefSize(id control) s.width = (intptr_t) r.size.width; s.height = (intptr_t) r.size.height; return s; +} + +struct xsize areaPrefSize(id scrollview) +{ + NSView *c; + NSRect r; + struct xsize s; + + c = areaInScrollView(toNSScrollView(scrollview)); + // don't size to fit; the frame size is already the size we want + r = [c frame]; + s.width = (intptr_t) r.size.width; + s.height = (intptr_t) r.size.height; + return s; } \ No newline at end of file -- cgit v1.2.3