Connecting User Interface Objects to Your C Source Code
- Updated2023-02-21
- 1 minute(s) read
Connecting User Interface Objects to Your C Source Code
To establish the connection between the objects in .uir files and C source files, prepare and include a header file with the source code as follows:
- Give each control a constant name. Constant names identify the controls on the GUI in calls to the User Interface Library functions. Several rules govern your choice of constant names.
- As appropriate, assign callback functions to controls in the User Interface Editor. For example, to have a function called AcquireData execute whenever the command button Acquire is clicked, assign the callback function name AcquireData to the Acquire button in the User Interface Editor.
- Save the .uir file. LabWindows/CVI then automatically generates the necessary header (.h) file which contains the appropriate callback functions and ID constant names.
- Include this .h file in the application program using the #include preprocessor command. The #include directive allows the program to reference the resource IDs and callback functions for the user interface objects. In contrast, panel and menu bar handles are obtained at run time when using the LoadPanel and LoadMenuBar functions.