In prolog I have do to something like this:
************************
* *
* ########## *
* # button # *
* ########## *
* *
************************
User gives the width and height of window (created with *), and coordinates, width, height and text of button (created by #). This “window” is written in prolog console. I don’t have trouble with writing the window itself but I don’t know how to do it with something in it. Can anyone help me, I don’t mean writing it for me, but even small guidenes will be helpfull.
Write it with the help of a DCG as a clean grammar.
Here is a start. More details, here.
Now you can query it on the toplevel:
And you can print it out directly: