简体   繁体   中英

Prolog - sending text from menu(cycle) to text_item

This is my code:

   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).

I want to send chosen text option from menu(cycle) MCom to text_item blank row N5 by click ok button. Do you know how to do it? I tried using @prolog message and function...with send(A,append,B), but it doesn't works...

I don't understand much of your code (specially message(SS, destroy)) : what's the purpose?), then forgive me if I post a misleading hint, but

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

paired with

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

seems to work. I get some_text in N5 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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