Skip to content

Instantly share code, notes, and snippets.

@jaredly jaredly/current.m
Created Jan 25, 2019

Embed
What would you like to do?
CAMLprim value fluid_create_ScrollView(value dims_v) {
CAMLparam1(dims_v);
CAMLlocal1(view_v);
log("Create scroll view\n");
Unpack_record4_double(dims_v, left, top, width, height);
NSRect frame = NSMakeRect(left, top, width, height);
NSScrollView* view = [[NSScrollView alloc] initWithFrame:frame];
[view setHasVerticalScroller:YES];
[view setHasHorizontalScroller:NO];
[view setAutoresizingMask:NSViewWidthSizable |
NSViewHeightSizable];
Wrap(view_v, view);
CAMLreturn(view_v);
}
type dims = {left: float, top: float, width: float, height: float};
type scrollView;
let%autogen fluid_create_ScrollView = ({left, top, width, height}: dims): scrollView => {|
NSRect frame = NSMakeRect(left, top, width, height);
NSScrollView* view = [[NSScrollView alloc] initWithFrame:frame];
[view setHasVerticalScroller:YES];
[view setHasHorizontalScroller:NO];
[view setAutoresizingMask:NSViewWidthSizable |
NSViewHeightSizable];
return view;
|};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.