Current section
Files
Jump to
Current section
Files
src/examples@forms.erl
-module(examples@forms).
-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_forms(_pipe),
_pipe@2 = gu:set_title(_pipe@1, <<"Forms"/utf8>>),
_pipe@3 = gu:add_entry(_pipe@2, <<"Entry"/utf8>>),
_pipe@4 = gu:add_password(_pipe@3, <<"Password"/utf8>>),
_pipe@5 = gu:add_list_and_values(
_pipe@4,
<<"List"/utf8>>,
[<<"One"/utf8>>,
<<"Two"/utf8>>,
<<"Three"/utf8>>,
<<"Unu"/utf8>>,
<<"Du"/utf8>>,
<<"Tri"/utf8>>,
<<"Едно"/utf8>>,
<<"Две"/utf8>>,
<<"Три"/utf8>>],
{some, [<<"1"/utf8>>, <<"2"/utf8>>, <<"3"/utf8>>]}
),
_pipe@6 = gu:set_show_header(_pipe@5),
_pipe@7 = gu:add_combo_and_values(
_pipe@6,
<<"Combo"/utf8>>,
[<<"One"/utf8>>, <<"Two"/utf8>>, <<"Three"/utf8>>]
),
_pipe@8 = gu:set_separator(_pipe@7, <<"|"/utf8>>),
gu:run(_pipe@8, false)
end,
case Answer of
{some, {_, Val}} ->
case gu:parse_list(Val, <<"|"/utf8>>) of
[Entry, Password, List123, Combo] ->
_pipe@9 = [<<"zenity"/utf8>>],
_pipe@10 = gu:new_info(_pipe@9),
_pipe@11 = gu:set_text(
_pipe@10,
<<<<<<<<<<<<<<"Entry: "/utf8, Entry/binary>>/binary,
"\nPassword: "/utf8>>/binary,
Password/binary>>/binary,
"\nList: "/utf8>>/binary,
List123/binary>>/binary,
"\nCombo: "/utf8>>/binary,
Combo/binary>>
),
_pipe@12 = gu:set_timeout(_pipe@11, 10),
gu:run(_pipe@12, false),
nil;
_ ->
nil
end;
none ->
nil
end.