1

This is a button:

new(B,button(solve, message(@prolog, solve))),
    send(D,display,B),
    send(D, open),

This is a function:

solve(D, Row, Column) :-
    assert(path([[0, 0], [-1, 0]])),
    track(Row, Column),
    path(P),
    show_track(D,P).

How should I do?

BenMorel
  • 34,448
  • 50
  • 182
  • 322

1 Answers1

1

Here goes a sample to get you started:

:- use_module(library(pce)).

test:-
    new(D, dialog),
    new(W,  window('Test', size(100, 100))),
    send(D, append, new(B,button(solve, message(@prolog, solve, D, 10, 20)))),
    send(D, below, W),
    send(D, open),
    !.

solve(D, Row, Column) :-
  writeln(solve(D, Row, Column)).

Basically you have to add the arguments to the message, in this case I used D for the dialog and the constants 10 and 20 for Row and Column, and just print them to console in the solve/3 procedure.

gusbro
  • 22,357
  • 35
  • 46