繁体   English   中英

Prolog-将文本从菜单(循环)发送到text_item

[英]Prolog - sending text from menu(cycle) to text_item

这是我的代码:

   listaw1:-

 new(SS, dialog('text')),
 send(SS, display,new(W3, text('text'))),
 send(SS, append, new(N5,text_item('dfsdfsdf'))),

 send(SS, append, new(MCom,menu(nazwa_komponentu,cycle))),

 send_list(MCom, append, [some_text]),

  send(SS, append,
         button(ok, and(message(@prolog, function,
                                           MCom?selection,

                                           N5?selection),

                                           message(SS, destroy)))),
get(SS, confirm, Rval),
send(SS,open).

 function(MCom,N5):-send(MCom, append, N5).

我想通过单击“确定”按钮将选定的文本选项从菜单(周期)MCom发送到text_item空白行N5。 你知道怎么做吗? 我尝试使用@prolog消息和函数...与send(A,append,B)一起使用,但不起作用...

我不太了解您的代码(特别是message(SS, destroy)) :目的是什么?),如果发布了误导性提示,请原谅我,但是

...
send(SS, append,
  button(ok, message(@prolog, function, MCom, N5))),
...

与配对

function(MCom, N5):-
    get(MCom, selection, Selected),
    send(N5, selection, Selected).

似乎有效。 我在N5得到了some_text

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM