Discussions related to Visual Prolog
fred malack
Active Member
Posts: 28 Joined: 9 Mar 2014 6:35
Unread post
by fred malack » 3 Jun 2014 21:24
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
Thomas Linder Puls
VIP Member
Posts: 1399 Joined: 28 Feb 2000 0:01
Unread post
by Thomas Linder Puls » 4 Jun 2014 8:03
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