Skip to Main Content
Volume 6A: Motif Programming Manual
book

Volume 6A: Motif Programming Manual

by David Brennan, Dan Heller, Paula Ferguson
September 1993
Intermediate to advanced content levelIntermediate to advanced
1014 pages
28h 26m
English
O'Reilly Media, Inc.
Content preview from Volume 6A: Motif Programming Manual
XmListDeletePos (list_w, cbs−>item_position);
/* it's a long way, but traverse to To: text field */
XmProcessTraversal (list_w, XmTRAVERSE_NEXT_TAB_GROUP);
}
/* send_it() −− callback for when user clicked on Send. Build
* a command line, use popen() to open pipe to mail command, send
* text data to it and then exit. The message is sent to all
* of the addresses that have been specified and are shown in the
* list.
*/
void
send_it(w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
{
Widget send_w;
XmAnyCallbackStruct *cbs = (XmAnyCallbackStruct *) call_data;
char *text, *subj, cmd[BUFSIZ], *p, *dummy, *getenv();
int n, i, status;
XmString *list;
FILE *pp, *popen();
if (w == text_w) {
send_w = (Widget) client_data;
XtCallActionProc (send_w, "ArmAndActivate", cbs−>event, NULL, 0);
return;
}
/* if something was left in the To: field, grab it */
text = XmTextGetString (to_w);
if (text != 0 && *text != 0) {
XmString str = XmStringCreateLocalized (text);
XmListAddItemUnselected (list_w, str, 0);
XmTextSetString (to_w, "");
XmStringFree (str);
XtFree (text);
}
/* Get the list of users entered */
XtVaGetValues (list_w,
XmNitems, &list,
XmNitemCount, &n,
NULL);
if (n == 0) {
static Widget dialog;
/* user goofed −− must provide at least one recipient */
if (!dialog) {
Arg args[5];
n = 0;
XtSetArg (args[n], XmNdialogStyle,
XmDIALOG_APPLICATION_MODAL); n++;
dialog = XmCreateErrorDialog (to_w, "error", args, n);
XtUnmanageChild (
XmMessageBoxGetChild (dialog, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 7A: XView Programming Manual

Volume 7A: XView Programming Manual

Dan Heller

Publisher Resources

ISBN: 9780596000431