 The first step in developing an event-driven program is to write a series of subroutines, or methods, called event-handler routines.These routines handle the events to which the main program will respond.For example, a single left-button mouse-click on a command button in a GUI program may trigger a routine that will open another window, save data to a database or exit the application.