home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / windows / openloo / 3645 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.7 KB  |  53 lines

  1. Newsgroups: comp.windows.open-look
  2. Path: sparky!uunet!stan!imp
  3. From: imp@solbourne.com (Warner Losh)
  4. Subject: Re: Q: C++ and callback problems.
  5. Message-ID: <Btpy3G.Dnu@solbourne.com>
  6. Organization: Solbourne, User Interface Group
  7. References: <BtoEBG.Gq7@solbourne.com> <1992Aug28.161556.17176@isy.liu.se>
  8. Date: Sat, 29 Aug 1992 00:16:27 GMT
  9. Lines: 42
  10.  
  11. In article <1992Aug28.161556.17176@isy.liu.se> svan@isy.liu.se writes:
  12. >How then do these toolkits handle callbacks/events?
  13.  
  14. OI does a variation of method 1 (except that it does do non-static
  15. member functions correctly).  Interviews uses a variation of method 2.
  16.  
  17. >1) Cloning & modifying.
  18. >   You create a Button-object and then modifies it by
  19. >   registering your c-style callbackfunction.
  20.  
  21. In OI, you can regstier a C or a C++ style callback.  Just an
  22. overloaded call.  For example,
  23.     OI_menu_cell *cellp;
  24.     MyClass        *mcp;
  25.  
  26.     // call ::foo when button activated.
  27.     cellp->change_action( &foo );
  28.  
  29.     // call MyClass::bar when button activated
  30.     cellp->change_action( mcp, (OI_action_memfnp) &MyClass::bar );
  31.  
  32. >   The callback *HAS* to be a static memberfunction or an
  33. >   ordinary c-style function (possibly a friend).
  34.  
  35. Since OI provides member functions callbacks, I would say you are
  36. misinformed about this requirement.
  37.  
  38. >   Why has Borland C++ for Windows extended 
  39. >   their language just to handle callbacks from Windows?
  40.  
  41. I don't know.  I don't use Windows.
  42.  
  43. >What I really would like is:
  44. >   To have the possibility to make calls to a memberfunction of
  45. >   an object without having to know that objects particular class.
  46.  
  47. That's what OI provides you.
  48.  
  49. Warner
  50. -- 
  51. Warner Losh        imp@Solbourne.COM
  52. I've almost finished my brute force solution to subtlety.
  53.