问题
So, I have a college project now that uses Prolog, I'm not the first one to work on the code so it's already pretty huge, but I have to put it working with a Prolog graphical interface, so my question is: is there any Prolog graphical interface that doesn't require me to change the code that's already written?
回答1:
Another option you might want to look into:
https://www.gtk-server.org
回答2:
Besides SWI-Prolog own XPCE GUI toolkit, as mentioned in the comments, another possibility is to write the GUI in Java and use the SWI-Prolog JPL library to interface with it. The SWI-Prolog distribution includes some JPL examples that showcase GUI elements.
Adding a GUI interface to what, I assume, is currently a command-line application, will be facilitated if the Prolog application is already abstracting I/O using mechanisms such as the message printing mechanism. If that's already the case, the messages being printed can be intercepted using a hook predicate to display them in GUI elements.
来源:https://stackoverflow.com/questions/54445286/an-easy-to-implement-prolog-graphical-interface