I’m using: SWI-Prolog version 8.0.3 on Ubuntu 16.04.6 x86_64
When I run the code (see a MWE below) which has a rule that creates a window with menus in XPCE, swipl throws a syntax error which is difficult to understand. It seems related to @prolog.
On the other hand, the same script is accepted by swipl 7.2.3 (on a different machine with Ubuntu 16.04.6 x86_64).
How I can make my old script work with 8.0.3 which uses XPCE windows and menus?
The content of menu_xpce.pl
displayTree(FontSize, Problem_Id) :-
atomic_list_concat(['Natural Tableau: problem ID = ', Problem_Id], FrameTitle),
new(Frame, frame(FrameTitle)),
send(Frame, open),
send(Frame, append, new(Pic, picture)),
send(Pic, height, 600),
send(Pic, display, new(TxtRef, text('Sample Text', center, font(screen, roman, FontSize)))),
send(new(Menu, dialog), above, Pic),
send(Menu, append, new(MB, menu_bar)),
send(MB, append, new(File, popup('File'))),
send(File, append, menu_item(export_as_tikzpicture, message(@prolog, drawInLatex, tikzpicture), 'Export as LaTex (Tikzpicture)')),
send(File, append, menu_item(export_as_forest, message(@prolog, drawInLatex, forest), 'Export as LaTex (Forest)')),
send(MB, append, new(View, popup('View'))),
send(View, append, menu_item(zoom_in, message(@prolog, zoom, Pic, TxtRef, in), 'Zoom in')), %zoom(Pic, TxtRef, Mode)
send(View, append, menu_item(zoom_out, message(@prolog, zoom, Pic, TxtRef, out), 'Zoom out')),
send(View, append, menu_item(zoom_in_x2, message(@prolog, zoom, Pic, TxtRef, in_x2), '2 x Zoom in')),
send(View, append, menu_item(zoom_out_x2, message(@prolog, zoom, Pic, TxtRef, out_x2), '2 x Zoom out')).
Running with 8.0.3
~$ swipl -f menu_xpce.pl
ERROR: /home/kowalsky/juno/net/aistaff/lasha/swipl_xpce_test/menu_xpce.pl:12:61: Syntax error: Operator expected
Welcome to SWI-Prolog (threaded, 64 bits, version 8.0.3)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?-
Running with 7.2.3
~$ swipl -f menu_xpce.pl
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.2.3)
Copyright (c) 1990-2015 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.
For help, use ?- help(Topic). or ?- apropos(Word).
?-