Seregon/StratoSDK

StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.

Rust/27.3 KB/No license
crates/strato-ui-renderer/src/platform/mac/objc/alert.m
1#import <AppKit/AppKit.h>
2 
3#import "app.h"
4 
5NSModalResponse configureAndRunModal(NSAlert *alert, NSApplication *app) {
6 alert.showsSuppressionButton = YES;
7 
8 // It is generally frowned-upon to be overly assertive about putting our windows
9 // in the user's face. However, it is reasonable to do this before showing our modal.
10 // If we don't make ourselves the top active app, our modal might show up BEHIND an-
11 // other app's window.
12 [app activateIgnoringOtherApps:YES];
13 NSModalResponse response = [alert runModal];
14 
15 return response;
16}
17