Dialogs
The Native SDK provides native file and message dialogs accessible from Zig via Runtime.showOpenDialog(...), Runtime.showSaveDialog(...), and Runtime.showMessageDialog(...), or from JavaScript via the builtin bridge.
Open file dialog
| Field | Type | Default |
|---|---|---|
title | []const u8 | "" |
default_path | []const u8 | "" |
filters | []const FileFilter | &. |
allow_directories | bool | false |
allow_multiple | bool | false |
Returns OpenDialogResult with count and paths.
Save file dialog
| Field | Type | Default |
|---|---|---|
title | []const u8 | "" |
default_path | []const u8 | "" |
default_name | []const u8 | "" |
filters | []const FileFilter | &. |
Returns an optional path string.
Message dialog
| Field | Type | Default |
|---|---|---|
style | MessageDialogStyle | .info |
title | []const u8 | "" |
message | []const u8 | "" |
informative_text | []const u8 | "" |
primary_button | []const u8 | "OK" |
secondary_button | []const u8 | "" |
tertiary_button | []const u8 | "" |
MessageDialogStyle: info, warning, critical
MessageDialogResult: primary, secondary, tertiary
FileFilter
From JavaScript
Dialogs require the builtin bridge to be enabled with an explicit policy that grants the dialog permission. JSON field names use camelCase: