You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-35Lines changed: 15 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,7 @@
8
8
9
9
## The Story
10
10
11
-
Picture this: you're writing a Rust CLI tool and you just want to pop up a little
12
-
dialog that says _"hey, what's your name?"_ and take whatever the user types.
13
-
Simple, right?
11
+
Picture this: you're writing a Rust CLI tool and you just want to pop up a little dialog that says _"hey, what's your name?"_ and take whatever the user types. Simple, right?
14
12
15
13
So you look at the ecosystem.
16
14
@@ -19,16 +17,13 @@ So you look at the ecosystem.
19
17
-**`tinyfiledialogs`**: `input_box` looks promising! ...but why does my input box turn into a password input when `default` is empty (`Some("")`)? No multiline, no custom labels, no control over backends... Oh and it's a C binding.
20
18
-**`dialog`**: Finally, an input box! ...but not for Windows or macOS. It fully depends on tools like `zenity`, `kdialog` or `dialog`.
21
19
22
-
You stare into the void. The void stares back. You write the dialog in HTML/JS
23
-
because at least Electron works on all platforms.
20
+
You stare into the void. The void stares back. You write the dialog in HTML/JS because at least Electron works on all platforms.
24
21
25
22
_Not anymore._
26
23
27
24
## What `inputbox` Does
28
25
29
-
`inputbox` is a minimal, cross-platform Rust library that shows a native GUI
30
-
input dialog and returns what the user typed. It uses whatever is available on
31
-
the system. Should work™ most of the time.
26
+
`inputbox` is a minimal, cross-platform Rust library that shows a native GUI input dialog and returns what the user typed. It uses whatever is available on the system. Should work™ most of the time.
32
27
33
28
## Quick Start
34
29
@@ -106,40 +101,25 @@ InputBox::new()
106
101
107
102
-**Multiple input modes** — text, password, or multiline
108
103
-**Highly customizable** — title, prompt, button labels, dimensions, and more
109
-
-**Works on most platforms** — Windows, macOS, Linux, Android, iOS nad OpenHarmony
104
+
-**Works on most platforms** — Windows, macOS, Linux, Android, iOS and OpenHarmony
110
105
-**Pluggable backends** — use a specific backend or let the library pick
111
106
-**Synchronous and asynchronous** — safe sync on most platforms, async required on iOS
|`PSScript`| Windows | PowerShell + WinForms, no extra install needed | None |
113
+
|`JXAScript`| macOS |`osascript` JXA, built into the OS | None |
114
+
|`Android`| Android | AAR + JNI to show an Android AlertDialog | Include AAR in APK |
115
+
|`IOS`| iOS | UIKit alert | None |
116
+
|`OHOS`| OpenHarmony | NAPI + ArkTS dialog | See [OHOS setup](#ohos-setup)|
117
+
|`Yad`| Linux |[`yad`](https://github.com/v1cont/yad)| Install `yad`|
118
+
|`Zenity`| Linux |`zenity` — fallback on GNOME systems | Install `zenity`|
124
119
125
-
### Linux Installation
120
+
### OHOS Setup
126
121
127
-
```bash
128
-
# Arch Linux
129
-
sudo pacman -S yad
130
-
131
-
# Debian/Ubuntu
132
-
sudo apt install yad
133
-
134
-
# Fedora
135
-
sudo dnf install yad
136
-
137
-
# or use zenity (usually pre-installed on GNOME)
138
-
sudo apt install zenity
139
-
```
140
-
141
-
The `show()` method automatically picks the best backend for the current platform.
142
-
You can also specify one explicitly via `show_with()`.
122
+
Currently you need to implement the ArkTS dialog yourself and use `registerInputboxCallback` to connect it to `inputbox`. See the [OHOS example](https://github.com/Mivik/inputbox/tree/main/examples/ohos) for setup details.
0 commit comments