Page 1 of 1

Help me to fix this button.

Posted: 3 Jun 2014 21:24
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.

Posted: 4 Jun 2014 8:00
by Tonton Luc

Try this :

Code: Select all

      clauses      onOkClick(_Source) = button:: defaultAction.                destroy().

Posted: 4 Jun 2014 8:03
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().