Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous IO πŸ‘―β€β™€οΈπŸ‘―β€β™‚οΈ #39

Merged
merged 8 commits into from
Jan 29, 2019
Prev Previous commit
Next Next commit
Use noalloc version for Window.contentHeight
  • Loading branch information
wokalski committed Jan 29, 2019
commit a543c0eee557db3466cfa929f0777fe9e8d8b5fa
5 changes: 3 additions & 2 deletions renderer-macos/lib/bindings/BriskWindow.re
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ external _NSWindow_setContentView: (window, view) => unit =
[@noalloc]
external _NSWindow_contentWidth: window => [@unboxed] float =
"ml_NSWindow_contentWidth" "ml_NSWindow_contentWidth";
external _NSWindow_contentHeight: window => float =
"ml_NSWindow_contentHeight_bc" "ml_NSWindow_contentHeight_bc";
[@noalloc]
external _NSWindow_contentHeight: window => [@unboxed] float =
"ml_NSWindow_contentHeight_bc" "ml_NSWindow_contentHeight";
external setOnWindowDidResize: (window, unit => unit) => unit =
"ml_NSWindow_setOnWindowDidResize";

Expand Down
10 changes: 6 additions & 4 deletions tester-macos/bin/app.re
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,22 @@ let () = {
let view = BriskView.make();
let layoutNode =
makeLayoutNode(
~style=[width(Window.contentWidth(window)), height(Window.contentHeight(window))],
~style=[
width(Window.contentWidth(window)),
height(Window.contentHeight(window)),
],
view,
);
{Brisk.OutputTree.view, layoutNode};
};

Window.center(window);
Window.makeKeyAndOrderFront(window);
Window.setTitle((window), appName);
Window.setTitle(window, appName);
Window.setContentView(window, root.view);

Window.windowDidResize(window, _ => {
Window.windowDidResize(window, _ =>
Brisk.UI.setWindowHeight(Window.contentHeight(window))
}
);

Brisk.UI.renderAndMount(
Expand Down