Adding Items to a List

In Checkbook, when the user presses "Add", then "OK" in the check edit window, an item is added to the list. This is done as follows:

Note the last step: anytime the number of items in a list changes, GSsetsclistnumitems() should be called. Passing "TRUE" as the last parameter causes the list to be redrawn. Also note that the number of list items is actually 3*num_checks, since each check has three items in the list.

Deleting Items from a List

When the user presses "Delete", the current item (the one shown in red) is removed from the list. This is done as follows:

The Complete Source Code

The source code for the completed checkbook example is available.