Discussions related to Visual Prolog
fred malack
Active Member
Posts: 28
Joined: 9 Mar 2014 6:35

Help me to fix this button.

Unread post by fred malack »

Hello i need help unfortunately when i was designing
The dialog i deleted the default ok button
And i placed another button i want when i click ok to close it.

Code: Select all

     Predicates         OnOkClick : button :: clickResponder.         clauses      OnOkClick(_Source) = button:: defaultAction.                _ = listparent::destroy(This).
It gives me error.
fr@dlu
User avatar
Tonton Luc
VIP Member
Posts: 204
Joined: 16 Oct 2001 23:01

Unread post by Tonton Luc »

Hi,

Try this :

Code: Select all

      clauses      onOkClick(_Source) = button:: defaultAction.                destroy().
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Buttons have a Style property, with possible values Regular, OK and Cancel.

One button on the dialog can have Style=OK and one button can have Style=Cancel, the rest should have Style=Regular.

So if you give your new button OK-style, and remove the handler you have attached it will work like the OK button you have accidentally deleted.

However, if you want to destroy the dialog yourself, you should call the dialog's destroy.

Code: Select all

predicates     onOkClick : button::clickResponder. clauses     onOkClick(_Source) :- button::noAction :-         destroy().
Regards Thomas Linder Puls
PDC
Post Reply