PushButtons.
The pushed() callback function creates the SelectionDialogs. Since the list of items for a SelectionDialog must be
specified as an array of XmString values, the list passed in the client_data parameter must be converted. We
create an array of compound strings the size of the list and copy each item into the new array using
XmStringCreateLocalized(). The resulting list is used as the value for the XmNlistItems resource. The
number of items in the list is specified as the value of the XmNlistItemCount resource. This value must be given
for the list to be displayed. It must be less than or equal to the actual number of items in the list. We also set the
XmNlistLabelString resource to specify the label for the list of items in the dialog. The SelectionDialog also
provides the XmNlistVisibleItemCount resource for specifying the number of visible items in the list. We let
the dialog use the default value for this resource.
The final resource that we set for the SelectionDialog is XmNmustMatch. This resource controls whether an item
that the user types in the text entry area must match one of the items in the list. By setting the resource to True, we
are specifying that the user cannot make up a month or day name. When the user activates the OK button or presses
the RETURN key, the widget checks the item in the text entry area against those in the list. If the selection doesn't
match any of the items in the list, the program pops up a dialog that indicates the error.
Once the dialog ...