Tutorial Step 2

This sample shows you how to respond to an event occurring within your application. It also demonstrates the use of a WEL_MSG_BOX control and a redefinition of closeable from WEL_COMPOSITE_WINDOW .

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 WEL_FRAME_WINDOW displayed. If you click the left mouse button in the client area of the window, a 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 Common message hooks for more information. In this example, on_left_button_down has been redefined from WEL_WINDOW to display a 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 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

See Also:
Common message hooks

cached: 12/20/2024 8:54:25.000 PM