# Responding to Events in a Graphical User Interface

When you design a user interface, you are defining areas on your computer screen, in the form of controls, that can generate events. For example, when you click on a command button, the button generates a user interface event that LabWindows/CVI then passes to your C program. Actually, LabWindows/CVI controls generate multiple user interface events. For example, a single mouse-click on a command button can pass the following user interface events to your program for processing:

1. GOT_FOCUS event—If the command button is not the active control (does not have the input focus), a mouse-click on the button makes it the active control. When a control receives the input focus, a GOT_FOCUS event occurs.
2. LEFT_CLICK event—When users click with the left mouse button on the command button, a LEFT_CLICK event occurs. LabWindows/CVI user interface controls can recognize left, right, single, and double mouse clicks.
3. COMMIT event—When the user releases the mouse button, a COMMIT event occurs signifying that the user has performed a commit event on the control.

| Note Each control can have one or more control modes that determine how the control responds to events.