* for the problem, we need to set the shadow thickness of at least
* one of the buttons to 2, so that the entire RowColumn is
* initialized to the right size. But this will cause the button to
* have a visible border and make it appear preselected, so, we have
* to make it appear invisible. If it is invisible then it cannot be
* selected, but it just so happens that the last 5 days in
* the month will never have selectable dates, so we can use any one
* of those. To make the button invisible, we need to unmap the
* widget. We can't simply unmanage it or the parent won't consider
* its size, which defeats the whole purpose. We can't create the
* widget and then unmap it because it has not been realized, so it
* does not have a window yet. We don't want to realize and manage
* the entire application just to realize this one widget, so we
* set XmNmappedWhenManaged to False along with the shadow thickness
* being set to 2. Now the RowColumn is the right size.
*/
XtVaSetValues (months[month].dates[5][6],
XmNshadowThickness, 2,
XmNmappedWhenManaged, False,
NULL);
}
/* date_dialog() −− when a date is selected, this function is called.
* Create a dialog (toplevel shell) that contains a multiline text
* widget for memos about this date.
*/
void
date_dialog(w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
{
int date = (int) client_data;
Widget dialog;
XWindowAttributes xwa;
/* the dialog is stored in the PushButton's XmNuserData */
XtVaGetValues (w, XmNuserData, ...