home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.motif
- Path: sparky!uunet!spool.mu.edu!wupost!cs.uiuc.edu!vela!sglanger
- From: sglanger@vela.acs.oakland.edu (LANGER STEVEN C)
- Subject: Capturing the Close Gadget
- Message-ID: <1993Jan4.214038.11505@vela.acs.oakland.edu>
- Organization: Oakland University, Rochester MI.
- Distribution: na
- Date: Mon, 4 Jan 1993 21:40:38 GMT
- Lines: 53
-
- Hi all;
- A couple of days ago I noticed a posting of the wm_delete.c
- program from pg. 588 of Dan Heller's MOtif Programming manual
- I tried to run it, but during the compile I get parameter type
- mismatch on the final arg tin the XmAddWMProtocolCallback func.
-
- here's the basic code;
-
- Widget dialog, shell;
- Atom WM_DELETE_WINDOW;
-
- dialog = XtVaCreateManagedWidget ("title", xmDialogShellWidgetClass,
- mainWindow, XmNdeleteResponse, XmDO_NOTHING, NULL);
-
- XtManageChild (dialog);
-
- shell = XtParent (dialog);
- WM_DELETE_WINDOW = XmInternalAtom (XtDisplay(mainWindow),
- "WM_DELETE_WINDOW, False);
-
- XmAddWMProtocolCallback (shell, WM_DELETE_WINDOW, response, dialog);
- ------------------------------------------------------------------------^
- compiler says this should be a pointer to char (XtPointer) and not a
- pointer to struc (ie the Widget dialog).
-
- void response (Widget w, XtPointer data, XmAnyCallbackStruct *cbs)
- {
- printf (" in RESPONSE\n");
- }
-
- Furthermore, when I replace dialog with "test string" to get the comiler
- to not choke, the code rruns flawlessly, EXCEPT the resonse func is
- never entered.
-
- I apologise if there is a plethora of minor typose in the above,the
- VAX editor is abominable, but take my word for it, the only line
- the compiler chokes on is the one I indicated.
-
- Has anyone else tested this example and gotten it to work as
- written? I am using a SGI Indigo with IRIX 4.0.5
-
- --steve
- --
- Steve Langer sglanger@argo.acs.oakland.edu (VMS)
- Oakland University sglanger@vela.acs.oakland.edu (Ultrix)
- ---------------------------------------------------------------------------
- Standard disclaimers apply. In addition, the author makes no guarantees,
- concerning the grammatical accuracy of his writing. Therefore, any ^B's, ^C's,
- midword character additions/deletions and other non-sense which occurs (after
- the work leaves the author's decade old text editor via his decade old Amiga,
- struggles through a local 1200 baud Merit server to be further mauled via the
- remote VAX mail servers) is someone elses problem - namely yours.
- ---------------------------------------------------------------------------
-