Swi prolog 如何在xpce/prolog中创建一个按钮来执行某些功能
在xpce/prolog中,这是创建按钮打印句子的方法Swi prolog 如何在xpce/prolog中创建一个按钮来执行某些功能,swi-prolog,xpce,Swi Prolog,Xpce,在xpce/prolog中,这是创建按钮打印句子的方法 有没有办法,当我点击一个按钮,我想做一些功能,请帮助 从帮助>XPCE手册>浏览器>示例>获取者+右键单击+选择可以看到一个实用示例 ?- new(B, button(hello, message(@pce, write_ln, hello))). 打开突出显示的“创建人员”对话框后,单击鼠标右键,然后“查阅”应该会得到(我填写了一些值) 然后单击控制台中的创建输出 create_person_dial
有没有办法,当我点击一个按钮,我想做一些功能,请帮助 从
帮助>XPCE手册>浏览器>示例>获取者
+右键单击+选择
可以看到一个实用示例
?- new(B, button(hello,
message(@pce, write_ln, hello))).
打开突出显示的“创建人员”对话框后,单击鼠标右键,然后“查阅”应该会得到(我填写了一些值)
然后单击控制台中的创建
输出
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]).
通常,您需要将按钮附加到一些GUI以获得其功能
嗯
编辑这里是我在Windows上获得的布局
获取这两幅图像的方式有所不同:在Windows中,打开“帮助”主题后,我的关联菜单“咨询”处于活动状态。在Windows 7中,我没有这种对话框设计,您使用的是什么操作系统?
Creating male person goofy of 99 years old