Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!veritas!tsai From: tsai@Veritas.COM (Cary Tsai) Newsgroups: comp.windows.x Subject: Help!! Got CoreDump when I try to destroy MOTIF shell widget.. Message-ID: <1991Jan10.231010.5189@Veritas.COM> Date: 10 Jan 91 23:10:10 GMT Organization: VERITAS Software Lines: 58 I want to destroy a dialog window from its "Cancel" button, I got core dump all the time. Could any one tell me what's wrong with the following proc. /* compile this program with MOTIF 1.1 */ #include #include #include #include #include #include void newWin(), closeCB(); void closeCB(w, client, data) Widget w; Widget client; caddr_t data; { XtDestroyWidget(client); } main(argc, argv) int argc; char **argv; { Widget top, b1; top = XtInitialize(argv[0], "Ask", NULL, 0, &argc, argv); b1 = XtCreateManagedWidget("Push me to create a dialog box", xmPushButtonWidgetClass, top, NULL, 0); XtAddCallback(b1, XmNactivateCallback, newWin, top); XtRealizeWidget(top); XtMainLoop(); } void newWin(w, client, data) Widget w; caddr_t client; caddr_t data; { Widget top, b1, parent=(Widget) client; top = XmCreateFormDialog(w, "New Window", NULL, 0); b1 = XtCreateManagedWidget("Push me to close this box", xmPushButtonWidgetClass, top, NULL, 0); XtAddCallback(b1, XmNactivateCallback, closeCB, top); XtManageChild(top); } /* end */