[[Property:title|Tutorial Step 2]] [[Property:weight|1]] [[Property:uuid|f4a73538-8a2f-ce6b-5190-6bd4d0e8c8d1]] This sample shows you how to respond to an event occurring within your application. It also demonstrates the use of a [[ref:libraries/wel/reference/wel_msg_box_chart|WEL_MSG_BOX]] control and a redefinition of closeable from [[ref:libraries/wel/reference/wel_composite_window_chart|WEL_COMPOSITE_WINDOW]] . [[Image:step2|step2]]

==Compiling== * Launch EiffelStudio. * Click '''Add project''' * Browse to ''$ISE_EIFFEL\examples\wel\tutorial\step2\''. * Choose ''tutorial_step2.ecf'' * Choose the location where the project will be compiled, by default the same directory containing the configuration file. * Click '''OK'''. ==Running== After launching the sample, you should see a [[ref:libraries/wel/reference/wel_frame_window_chart|WEL_FRAME_WINDOW]] displayed. If you click the left mouse button in the client area of the window, a [[ref:libraries/wel/reference/wel_msg_box_chart|WEL_MSG_BOX]] will appear, notifying you of your click. ==Under the Hood== This system is a demonstration of how to connect an event to one of the common message hooks available within WEL. See [[WEL Common Concepts|Common message hooks]] for more information. In this example, on_left_button_down has been redefined from [[ref:libraries/wel/reference/wel_window_chart|WEL_WINDOW]] to display a [[ref:libraries/wel/reference/wel_msg_box_chart|WEL_MSG_BOX]] containing notification of the event occurring. If you look at closeable from MAIN_WINDOW, you will see that it has been redefined to display a [[ref:libraries/wel/reference/wel_msg_box_chart|WEL_MSG_BOX]] and the result from this message box is used to generate the return value of closeable. If this Result is True, the window will be closed. This sample contains the following classes: * TUTORIAL_STEP2 * MAIN_WINDOW {{seealso|
[[WEL Common Concepts|Common message hooks]]
}}