Current section

Files

Jump to
gu src examples@list.erl
Raw

src/examples@list.erl

-module(examples@list).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([main/0]).
-spec main() -> nil.
main() ->
Answer = begin
_pipe = [<<"zenity"/utf8>>],
_pipe@1 = gu:new_list(_pipe),
_pipe@2 = gu:set_title(_pipe@1, <<"List"/utf8>>),
_pipe@3 = gu:new_list_opts(
_pipe@2,
false,
false,
false,
{some, <<"|"/utf8>>},
true,
false,
none,
{some, 1},
false
),
_pipe@4 = gu:add_column(_pipe@3, <<"Language"/utf8>>),
_pipe@5 = gu:add_column(_pipe@4, <<"1"/utf8>>),
_pipe@6 = gu:add_column(_pipe@5, <<"2"/utf8>>),
_pipe@7 = gu:add_column(_pipe@6, <<"3"/utf8>>),
_pipe@8 = gu:add_row(
_pipe@7,
[<<"English"/utf8>>,
<<"One"/utf8>>,
<<"Two"/utf8>>,
<<"Three"/utf8>>]
),
_pipe@9 = gu:add_row(
_pipe@8,
[<<"Esperanto"/utf8>>,
<<"Unu"/utf8>>,
<<"Du"/utf8>>,
<<"Tri"/utf8>>]
),
_pipe@10 = gu:add_row(
_pipe@9,
[<<"Turkish"/utf8>>,
<<"Bir"/utf8>>,
<<"İki"/utf8>>,
<<"Üç"/utf8>>]
),
_pipe@11 = gu:add_row(
_pipe@10,
[<<"Bulgarian"/utf8>>,
<<"Едно"/utf8>>,
<<"Две"/utf8>>,
<<"Три"/utf8>>]
),
gu:run(_pipe@11, false)
end,
case Answer of
{some, {_, Val}} ->
_pipe@12 = [<<"zenity"/utf8>>],
_pipe@13 = gu:new_info(_pipe@12),
_pipe@15 = gu:set_text(
_pipe@13,
begin
_pipe@14 = gu:parse_list(Val, <<"|"/utf8>>),
gleam@string:join(_pipe@14, <<", "/utf8>>)
end
),
_pipe@16 = gu:set_timeout(_pipe@15, 10),
gu:run(_pipe@16, false),
nil;
none ->
nil
end.