Prolog XPCE按钮消息

时间:2015-04-02 17:11:58

标签: swi-prolog xpce

% Author:
% Date: 02/04/2015
:- use_module(library(pce)).
dialog('screen1',
       [ object        :=
           Screen_,
         parts         :=
           [ Screen_ := dialog('Screen1'),
             Button1 := button(button),
             Button2 := button(button)
           ],
         modifications :=
           [ Button2 := [ label := 'OpenScreen2'],
             Button1 := [ label := 'Quit'],
                            ],
         layout        :=
           [ area(Button2,area(124, 19, 89, 24)),
             area(Button1,area(127, 80, 80, 24))
           ]
       ]).
dialog('screen2',
       [ object        :=
           Screen_,
         parts         :=
           [ Screen_ := dialog('Screen2'),
             Button1 := button(button),
             Button2 := button(button)
           ],
         modifications :=
           [ Button2 := [ label := 'RunCode'],
             Button1 := [ label := 'Back']
           ],
         layout        :=
           [ area(Button2,area(146, 34, 80, 24)),
             area(Button1,area(148, 96, 80, 24))
           ]
       ]).


s_d :- make_dialog(M,screen1),
%send(M, append, button(quit, message(M, destroy))),
send(M, open).

我遇到按钮消息的问题,

  1. 我知道按钮退出的消息是破坏,但无法正确设置语法。
  2. button2,需要打开对话框屏幕2,所以我也需要帮助按钮2的消息。

0 个答案:

没有答案