Skip to content

Instantly share code, notes, and snippets.

@jaredly
Created January 25, 2019 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredly/8cb476bdce47296023d84344d9ad75dd to your computer and use it in GitHub Desktop.
Save jaredly/8cb476bdce47296023d84344d9ad75dd to your computer and use it in GitHub Desktop.
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