![]() | Programming Guide | WideStudio Index Table of contents |
How to add the event procedure on the programs
You can add the event procedure with the method: mwt::WSCbase_addProcedure().Add the event procedure as follows.
The method Description mwt::WSCbase_addProcedure($event_proc_name,$proc_name,$event) Add the new event procedure.
- (A), Create the procedure instance with the specified procedure name and a trigger.
- (B), Set a address of the procedure and its name with the method: setFunction().
- (C) Finally, add the procedure instance to the instance.
use mwt; # a sample of the event procedure. # .. sub _new_event_procedure { my ($object) = @_; return; } sub event_procedure { my ($object) = @_; # Create the procedure instance which name is "new-ep". # The trigger is WSEV_MOUSE_IN (MOUSE_IN trigger.) $object->addProcedure("new-ep","_new_event_procedure",$mwt::WSEV_MOUSE_IN); return; } 1;
Copyright(C) WideStudio Development Team, 1999-2005 | Last modified: Jan 05, 2005 |