StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.
| 1 | #import <AppKit/AppKit.h> |
| 2 | |
| 3 | #import "app.h" |
| 4 | |
| 5 | NSModalResponse 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 |