home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13181 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  1.9 KB

  1. Path: sparky!uunet!cs.utexas.edu!rutgers!cmcl2!acf5!checker
  2. From: checker@acf5.NYU.EDU (checker)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Callbacks - C++ needs an extension?
  5. Message-ID: <1896@acf5.NYU.EDU>
  6. Date: 2 Sep 92 05:09:49 GMT
  7. References: <1992Aug28.165108.17479@isy.liu.se>     <1992Aug29.161356.16729@genghis.borland.com> <1893@acf5.NYU.EDU> <DAVIDM.92Aug31105639@consilium.com>
  8. Distribution: comp
  9. Organization: New York University
  10. Lines: 31
  11.  
  12. davidm@consilium.com (David S. Masterson) writes:
  13. >Interesting technique, but I have a few questions:
  14.  
  15. >1.  Could you make this work in the case of windowing systems that treat
  16. >callbacks as C functions?  Would it be a double callback (ie. callback to a C
  17. >function that then calls the appropriate callback object)?
  18.  
  19. I'm working on this one.  I have an idea (in the formative stages) for a
  20. way to bind the necessary object and its member function together into a
  21. C style function using templates, but I'm going to wait until it is
  22. better developed before I post it.
  23.  
  24. >2.  How does the windowing system pass data to the callback?  With buttons,
  25. >for instance, all that needs to be known is the action (buttonPush).  With
  26. >text widgets, though, the program will want to get at the data that is
  27. >provided in the event.
  28.  
  29. See my latest post for the way to send data to the function.  Basically,
  30. you use templates to specify the types you want the callback function to
  31. take; it's easy.
  32.  
  33. >3.  Given a windowing system based on C, its likely that the information
  34. >coming from the windowing system will not be C++ object oriented (ie. it won't
  35. >follow a C++ inheritance model).  How do you convert?
  36.  
  37. This is a big problem.  The first step is to get as far away from the C
  38. interface level as you can.  There are plenty of C++ abstractions for
  39. almost any C based windowing system.  I haven't seen any that are
  40. entirely satisfactory, but it is a young market, and that will change.
  41.  
  42. Chris
  43.