Current section
Files
Jump to
Current section
Files
src/examples@entry.erl
-module(examples@entry).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([main/0]).
-spec main() -> {ok, binary()} | {error, {integer(), binary()}}.
main() ->
Answer = begin
_pipe = [<<"zenity"/utf8>>],
_pipe@1 = gu:new_entry(
_pipe,
{some, <<"Enter text"/utf8>>},
{some, <<"text..."/utf8>>},
false
),
_pipe@2 = gu:set_title(_pipe@1, <<"Entry"/utf8>>),
_pipe@3 = gu:prompt(_pipe@2),
gleam@result:unwrap(_pipe@3, <<"No answer"/utf8>>)
end,
_pipe@4 = [<<"zenity"/utf8>>],
_pipe@5 = gu:new_info(_pipe@4),
_pipe@6 = gu:set_text(_pipe@5, Answer),
_pipe@7 = gu:set_timeout(_pipe@6, 10),
gu:show(_pipe@7, true).