Creating Graphical User Interfaces Previous page   Next Page

The List Box Callback and Create Function

This GUI does not use the list box callback since the actions performed on list box items are carried out by push buttons (Simulate and store results, Remove, and Plot). However, GUIDE automatically inserts a callback stub when you add the list box and automatically sets the Callback property to execute this subfunction whenever the callback is triggered (which happens when users select an item in the list box).

In this case, there is no need for the list box callback to execute, so you should delete it from the GUI M-file. It is important to remember to also delete the Callback property string so MATLAB does not attempt to execute the callback. You can do this using the property inspector:

property editor showing deleted call back property string

See the description of list boxes for more information on how to trigger the list box callback.

Setting the Background to White

The list box create function enables you to determine the background color of the list box. The following code shows the create function for the list box that is tagged ResultsList.


Previous page  The GUI Help Button An Address Book Reader Next page

© 1994-2005 The MathWorks, Inc.