Submitted by Anonymous (not verified) on Fri, 06/15/2012 - 12:07
Dear reader,
I am calling for a popupscreen in a piece of code and I want to go back to that piece of code after destroying the popupscreen. But it doesn`t. What am I forgetting?
My piece of code is as follows
if (strcmp(cValueTF, cValueTF1) == 0)
{
popup(widget, XmNactivateCallback, "Version == Previous version
Testprogram will not be copied.");
return 0;
} else if (strcmp(cValueTF, cValueTF1) < 0) {
popup(widget, XmNactivateCallback, "Version < Previous version
Testprogram will not be copied.");
return 0;
} else {
return 1;
}
The popup function =
/*=============================================================*/
void exit_main(Widget widget, XtPointer client_data, XtPointer call_data)
{
Widget shell = (Widget) client_data;
XtDestroyWidget (shell);
/*exit(0);*/
}
/*=============================================================*/
void popup (Widget w, XtPointer client_data, XtPointer call_data)
{
Widget dialog, shell, toplevelError;
XmString t;
Arg args[5];
int n, argc = 1;
char *argv[1] = {""}, *text = (char *) call_data;
XtAppLock(app);
display = XtOpenDisplay(app, NULL, "test", "Test", NULL, 0, &argc, argv);
toplevelError = XtVaAppCreateShell("Error", "Error", applicationShellWidgetClass, display, NULL);
n = 0;
t = XmStringCreateLocalized (text);
XtSetArg (args[n], XmNmessageString, t); n++;
dialog = XmCreateMessageBox (toplevelError, "Error Message", args, n);
XmStringFree (t);
XtSetSensitive (XtNameToWidget (dialog, "Help"), False);
XtSetSensitive (XtNameToWidget (dialog, "Cancel"), False);
XtAddCallback (dialog, XmNokCallback, exit_main, (XtPointer) toplevelError);
XtManageChild (dialog);
XtRealizeWidget (toplevelError);
XtAppUnlock(app);
XtAppMainLoop (app);
}
‹ XmProcessTraversal and Events. Stop XtAppMainLoop (app) ›
Mon, 10/27/2003 - 21:17#1
return to the code from where a message screen was called.
You`re not handling events. See the comp.windows.x FAQ for the "in-line dialog" question (www.faqs.org).