Hello everyone, I have a problem, if you can help me, I will be very glad.
I’m using: SWI-Prolog version 9.0.4
I need to implement a multi-selection, but I can’t extract the values of this selection.
I managed to implement a single choice, it looks like this:
send(W,append,new(S,menu('Your choice:'))),
send_list(S,append, [Answ_list]),
get(S?selection, selection, Answer),
As for the multi-selection:
:- use_module(library(pce)).
create_multi_select :-
new(Dialog, dialog('Multi-Selection Example')),
new(Multiselect, menu),
send_list(Multiselect, append, ['Option 1', 'Option 2', 'Option 3', 'Option 4']),
send(Multiselect, multiple_selection, @on),
send(Dialog, append, Multiselect),
send(Dialog, append, button('Submit', message(@prolog, show_selected, Multiselect))),
send(Dialog, open).
show_selected(Multiselect) :-
get(Multiselect,selection,Selections),
write(Selections).
But all I get is @xxxxxxxxxxxx
How can I read the “contents” of the selected responses?