gu
gleam add gu
import gleam/option.{None, Some}
import gu
pub fn main() {
let demo =
gu.zenity
|> gu.set_title("Demo")
|> gu.new_entry(
text: Some("What's Your Name?"),
entry_text: None,
hide_text: False,
)
|> gu.show(err: False)
let name = case demo {
Ok(val) -> gu.parse(val)
Error(_) -> "Unknown"
}
gu.zenity
|> gu.new_info()
|> gu.set_title("Demo")
|> gu.set_text("Hello, " <> name <> "!")
|> gu.show(True)
}
Examples
Links work on GitHub
zenity | code |
---|---|
--calendar | calendar.gleam |
--entry | entry.gleam |
--error | error.gleam |
--info | info.gleam |
--file-selection | file_selection.gleam |
--list | list.gleam |
--notification | notification.gleam |
--question | question.gleam |
--warning | warning.gleam |
--scale | scale.gleam |
--text-info | text_info.gleam |
--color-selection | color_selection.gleam |
--password | password.gleam |
--forms | forms.gleam |
Further documentation can be found at https://hexdocs.pm/gu.
gu was created for the needs of nemo_gleam.
Development
gleam run -m examples/forms # Run an example
gleam test # Run the tests
gleam shell # Run an Erlang shell