home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11627 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.4 KB  |  39 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!odin!gizmo.wpd.sgi.com!dyoung
  3. From: dyoung@gizmo.wpd.sgi.com (Doug Young)
  4. Subject: Re: C++ and XtAddEventHandler()
  5. Message-ID: <1992Jul27.200047.24078@odin.corp.sgi.com>
  6. Sender: news@odin.corp.sgi.com (Net News)
  7. Nntp-Posting-Host: gizmo.wpd.sgi.com
  8. Reply-To: dyoung@sgi.com
  9. Organization: Silicon Graphics, Inc.
  10. References:  <MeR3L4e00XQGISKrgK@andrew.cmu.edu>
  11. Date: Mon, 27 Jul 1992 20:00:47 GMT
  12. Lines: 25
  13.  
  14. |> Excerpts from netnews.comp.lang.c++: 20-Jul-92 C++ and
  15. |> XtAddEventHandler() by zhaocuie@iscs.nus.sg 
  16. |> >I'm using C++ to develop a GUI builder based on Motif, Xt, and X11.
  17. |> >Now I'm facing some problems. I need to call an Xt convienent function
  18. |> >        XtAddEventHandler(_w, event_mask, nonmaskable, proc, client_data)
  19. |> >to popup Motif popup menus. I wrote the codes as follows:
  20.  
  21. |> > 
  22. |> >        void Simple::postItEventHandler(Widget, XtPointer clientData, XtPointer)
  23.  
  24. |> >It does not work. The compiler said:
  25. |> >        error: bad argument 4 type for XtAddEventHandler(): void (*) (Widget,
  26. |> >        XtPointer, XtPointer) (XtEventHandler expected)
  27.  
  28.  
  29. Xt event handlers, after R4, have a fourth argument, Boolean *, which you
  30. are not including, therefore making the type of your function incorrect.
  31. Change your function declaration to:
  32.  
  33.   void Simple::postItEventHandler(Widget, XtPointer clientData, XtPointer, Boolean *)
  34.  
  35. and all should be well.
  36.  
  37. Doug Young
  38.  
  39.