home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.open-look
- Path: sparky!uunet!stan!imp
- From: imp@solbourne.com (Warner Losh)
- Subject: Re: Q: C++ and callback problems.
- Message-ID: <Btpy3G.Dnu@solbourne.com>
- Organization: Solbourne, User Interface Group
- References: <BtoEBG.Gq7@solbourne.com> <1992Aug28.161556.17176@isy.liu.se>
- Date: Sat, 29 Aug 1992 00:16:27 GMT
- Lines: 42
-
- In article <1992Aug28.161556.17176@isy.liu.se> svan@isy.liu.se writes:
- >How then do these toolkits handle callbacks/events?
-
- OI does a variation of method 1 (except that it does do non-static
- member functions correctly). Interviews uses a variation of method 2.
-
- >1) Cloning & modifying.
- > You create a Button-object and then modifies it by
- > registering your c-style callbackfunction.
-
- In OI, you can regstier a C or a C++ style callback. Just an
- overloaded call. For example,
- OI_menu_cell *cellp;
- MyClass *mcp;
-
- // call ::foo when button activated.
- cellp->change_action( &foo );
-
- // call MyClass::bar when button activated
- cellp->change_action( mcp, (OI_action_memfnp) &MyClass::bar );
-
- > The callback *HAS* to be a static memberfunction or an
- > ordinary c-style function (possibly a friend).
-
- Since OI provides member functions callbacks, I would say you are
- misinformed about this requirement.
-
- > Why has Borland C++ for Windows extended
- > their language just to handle callbacks from Windows?
-
- I don't know. I don't use Windows.
-
- >What I really would like is:
- > To have the possibility to make calls to a memberfunction of
- > an object without having to know that objects particular class.
-
- That's what OI provides you.
-
- Warner
- --
- Warner Losh imp@Solbourne.COM
- I've almost finished my brute force solution to subtlety.
-