?- new(B, button(hello,
message(@pce, write_ln, hello))).
xpce/prolog で、文を印刷するためのボタンを作成するこの方法は、ボタンをクリックしたときに何らかの機能を実行したい場合に役立ちます。
?- new(B, button(hello,
message(@pce, write_ln, hello))).
xpce/prolog で、文を印刷するためのボタンを作成するこの方法は、ボタンをクリックしたときに何らかの機能を実行したい場合に役立ちます。
Help > XPCE manual > Browsers > Examples > Obtainers
+ 右クリック +からSelect
、実際の例を見ることができます。
create_person_dialog :-
new(D, dialog('Enter new person')),
send(D, append, new(label)), % for reports
send(D, append, new(Name, text_item(name))),
send(D, append, new(Age, text_item(age))),
send(D, append, new(Sex, menu(sex, marked))),
send(Sex, append, female),
send(Sex, append, male),
send(Age, type, int),
send(D, append,
button(create, message(@prolog, create_person,
Name?selection,
Age?selection,
Sex?selection))),
send(D, default_button, create),
send(D, open).
create_person(Name, Age, Sex) :-
format('Creating ~w person ~w of ~d years old~n',
[Sex, Name, Age]).
ハイライトを開いた後create_person_dialog
、右クリックしてConsult
取得する必要があります(値を入力しました)
Create
コンソールで出力をクリックする
Creating male person goofy of 99 years old
attach
通常、機能を利用するには、いくつかの GUI にボタンを追加する必要があります。
HTH
ここで、Windows で取得したレイアウトを編集します
これら 2 つの画像を取得する方法には違いがあります。Windows では、ヘルプ トピックを開いた後にコンテキスト メニューをConsult
アクティブにしています。