Оконный интерфейс
Задача 1
w :- new(
Dialog, dialog("Find summa app")),
send_list(Dialog, append,
[
new(A, text_item(your_number_a)),
new(B, text_item(your_number_b)),
button(cancel, message(Dialog, destroy)),
button(enter, and(message(@prolog, myfunc, A?selection, B?selection)))
]),
send(Dialog, default_button, enter),
send(Dialog, open).
myfunc(A, B) :- atom_string(AA, A), atom_string(BB, B),
atom_number(AA, X), atom_number(BB, Y),
S is (X + Y),
format('A: ~w B: ~w S: ~w ~n', [A, B, S]).Задача 2
Last updated