ispresent_callback(+Source, +EventName, +DestinationClause)

This built-in predicate checks if the specified callback already exists or not, if the callback already exists then the clause is exited else it fails. The source object is the object which generates the event and the EventName must be the name of a documented event like 'OnSize' or 'OnCreate'. The DestinationClause method must be the name of a public clause. This predicate is part of the Windows API of Trinc-Prolog.

see also: add_callback/3 add_callback/4 callbacks class_name/2 clear_var/1 del_obj/1 get_instance/2 instance/1 new_obj/2 new_obja/2  object-oriented prolog remove_callback/4 <-/2 ::<-/1 ::<-/2 this/1

Examples
this(T),
ispresent_callback(T, onCreate, doCreate),
check if the 'onCreate' event of an instance is connected to the clause 'doCreate'
ispresent_callback(Instance, onBeforeSwitch, beforeSwitch) determine if the event 'onBeforeSwitch' of a control window is connected to the clause 'beforeSwitch'

 

Exceptions
Source and/or Destination are empty variables an instantiation_error exception is thrown
Source does not refer to an instance of a class a type_error(class_instance, Var) exception is thrown
EventName and/or DestinationClause are not atoms or variables containing atoms a type_error(atom, Name) exception is thrown
No event with the same name as EventName existence_error(class_method, Var) is thrown

 

 

info@trinc-prolog.com