# IDs and Handles in a User Interface Program

When you build your GUI programatically, you reference objects and assign callbacks as shown in the following table.

| Note When you build your GUI in the User Interface Editor, you reference objects and callbacks in different ways.

Assigning IDs and Callbacks through a Program

User Interface Object | How to Reference the Object | How to Assign a Callback to the Object
Control | Use the ID that NewCtrl returns. | Call InstallCtrlCallback.
Menu | Use the ID that NewMenu returns. | Call InstallMenuCallback.
Submenu | Use the ID that NewSubMenu returns. | Call InstallMenuCallback.
Menu item | Use the ID that NewMenuItem returns. | Call InstallMenuCallback.
Panel | Use the handle that NewPanel returns. | Call InstallPanelCallback.
Menu bar | Use the handle that NewMenuBar returns. | Call InstallMenuCallback.